标签:cti 路径 col color url blog csdn 字符 detail
错误的引入方式:
export default { data () { return{ imgUrl_homePage:‘@/assets/img/homePage_active.png‘ } } }
因为webpack是按字符号打包的,正确的引入方式:
1.import在外部引入
import img_url from ‘@/assets/img/homePage_active.png‘ export default { data () { return{ imgUrl_homePage:img_url } } }
2.require内部引入
export default { data () { return{ imgUrl_homePage:require(‘@/assets/img/homePage_active.png‘) } } }
参考---https://blog.csdn.net/qq_36485978/article/details/84821416?utm_medium=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-1.base&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-1.base
标签:cti 路径 col color url blog csdn 字符 detail
原文地址:https://www.cnblogs.com/pwindy/p/14933784.html