1 .数据初始化时引入
<template>
<img :src="imgsrc">
</template>
data(){
return {
imgsrc:require("../../assets/images/URLScheme.png"),
}
}
2.import 导入
import imgone from '../../assets/images/nodata.png';
<template>
<img :src="imgone">
</template>
3.mounted 中引入
data() {
return {
imgUrl:" "
}
}
mounted() {
let urlTemp = "assets/images/ios_phone.png";
this.imgUrl = require("@/" + urlTemp)
}
<template>
<img :src="imgUrl">
</template>
- 静态写入
<div>
<img
style="height: 25px; width: 20px"
:src="require('@/assets/images/ios_phone.png')"
/>
</div>