VUE - 加载图片
方式1:
<template> <div style="width: 100%; height: 100%"> <img :src="addjpg" :data-source="addjpg" alt="" /> </div> </template> <script> import addjpg from '@/assets/business/add.jpg'; export default { data() { return { addjpg, }; },
}
方式2:
<template> <div style="width: 100%; height: 100%"> <img :src="require('@/assets/' + src)" alt="" /> </div> </template> <script> export default { data() { return { src: 'business/add.jpg', }; }, }
end
标签:VUE,return,default,jpg,加载,data,图片 From: https://www.cnblogs.com/1285026182YUAN/p/17347386.html