App.js中引入图片:
import imgSrc from './fengjing.jpg';
// 注意单词不要拼写错误:from
var app = {
data() {
return {
imgSrc: imgSrc
}
},
template: `
<div>
<img src="imgSrc" />
</div>
`
};
export default app;import imgSrc from './fengjing.j