1、使用网络上的图片资源
<template>
<div>
<img :src="imgurl"></img>
</div>
</template>
export default {
data() {
return {
imgurl: 'http://www.codedemeter.com/blogfile/19_222949_14.jpg'
}
}
}
2、 使用import导入本地资源
import imgSrc from '../static/images/19_222949_14.png'
export default {
data() {
return {
imgurl: imgSrc
}
}
}
3、使用 require 导入
export default {
data() {
return {
imgurl: require('../static/images/19_222949_14.png')
}
}
}