解决方案:
把路径写进require(' src ')里面
<template>
<view>
<view v-for="(item,index) in arr">
<image :src="item.src"></image>
</view>
</view>
</template>
<script>
export default {
data() {
return {
arr:[
{src:'../image/t-e.png'},
{src:'../image/t-y.png'}
]
}
}
}
</script>
<template>
<view>
<view v-for="(item,index) in arr">
<image :src="item.src"></image>
</view>
</view>
</template>
<script>
export default {
data() {
return {
arr:[
{src:require('../image/t-e.png')},
{src:require('../image/t-y.png')}
]
}
}
}
</script>