2020-11-17Property “value“ was accessed during render but is not defined on instance
vue3中用vant插入图片,结果加载不出来。又不报错,而是显示Property “value” was accessed during render but is not defined on instance正确的写法是要src属性绑定requeir()方法错误的写法是:1没有:<van-image width="1.85rem" height="1.2rem" src="require
·
vue3中用vant插入图片,结果加载不出来。又不报错,而是显示Property “value” was accessed during render but is not defined on instance
正确的写法是要src属性绑定requeir()方法
错误的写法是:
1没有:
<van-image width="1.85rem" height="1.2rem" src="require('../assets/img/pic01.png')" />
没有用require来写
2
<template>
<div class="home">
<van-image width="1.85rem" height="1.2rem" src="require('../assets/img/pic01.png')" />
<van-image width="1.85rem" height="1.2rem" :src="require('../assets/img/pic02.png')" />
<van-image width="1.85rem" height="1.2rem" :src="require('../assets/img/pic03.png')" />
<van-image width="1.85rem" height="1.2rem" :src="require('../assets/img/pic04.png')" />
</div>
</template>
更多推荐
已为社区贡献1条内容
所有评论(0)