版权声明:未经同意,不得随意转载转载 https://blog.csdn.net/lucky541788/article/details/85049146
An error is reported as shown in the figure.
After consulting official documents, it turned out that there was no webpack problem, but another way was found.
First and foremost,putting your image‘s files in the public directory
In addition, you will need to first pass the base URL to your component in templates:
data () {
return {
baseUrl: process.env.BASE_URL
}
}
Then:
<img :src="`${baseUrl}my-image.png`">