When making a new version of the configuration interface, I used the vue framework to implement it. When configuring the page image, I found that there was a picture whose path was correct but the picture was not displayed. Phenomenon: The network page resources do not report an error, and the status code is still 200. There is nothing in the preview. After entering, I found that 200 appears for any word I enter. Solution: Configure the path of static resources in webpack 1. Find vue.config.js 2. Add a key in devServer under module.exports contentBase:path.join(_dirname,'src') This means that webpack-dev-server will use the current path as the requested resource path About contentBase, reference article https://www.jb51.net/article/222324.htm Static resources: Method 1: Directly enter the path <img class="sys_logo" src="./assets/images/top-logo.png"/> Method 2: Using require import logoUrl from './top-logo.png' const Images = { logoUrl } export default Images Method 3: Modularization import logoUrl from './top-logo.png' const Images = { logoUrl } export default Images use: js: import Images from './assets/images' html: <img class="sys_logo" :src="Images.logoUrl" /> This is the end of this article about the solution to the problem of images not displaying on vue pages. For more information about the problem of images not displaying on vue pages, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Detailed explanation of nginx configuration file interpretation
>>: MySQL database operations (create, select, delete)
Use profile to analyze slow SQL The main purpose ...
Table of contents Preface 1. Understanding with e...
Many people use Linux Homebrew. Here are three ti...
The file name of the dynamic library file under L...
Document Scope This article covers mode switching...
Table of contents 1. Constraint concepts and clas...
Table of contents background question Problem ana...
This article shares with you the installation and...
Table of contents Preface Rendering Example Code ...
Table of contents Overview Property settings Proc...
Table of contents Preface Mysql case when syntax:...
By default, MySQL in Linux distinguishes between ...
First put a piece of code for(int i=0;i<1000;i...
This article records the creation of a USB boot d...
I took the bus to work a few days ago. Based on m...