How to reference images in assets in vue
Introduced as img tag
<img class="img" alt="example" :src="require('./../assets/image/')">
Introduced as background image
<span :style="'background-image:url('+require('./../assets/image/')+')'" ></span>
Solve the problem of not finding the image path under Vue import assets
<img :src="imgsrc2"> export default{ data(){ imgsrc2: require('../assets/') } }
Summarize
The above is personal experience. I hope you can give you a reference and I hope you can support me more.