how to read the path of a picture in a local Json file in vue
{
"about":[
{"url":"require("./assets/img/about1.jpg")"},
{"url":"../../assets/img/about2.jpg"},
{"url":"../img/about3.jpg"}
],
}
referenced in the component Addressz
< el-col: xs= "24": sm= "8": lg= "8": xl= "8" class= "mt10 mtbox" v for = "ab in about": key= "ab.url" >
<div class="max-box">
<div class="tc"><img :src="ab.url"></div>
{{ab.p1}}
{{ab.p2}}
</div>
< / el-col >
import data from". / assets/json/data.json"
export default {
name: "Address",
data () {
return{
about:[]
}
},
mounted () {
this.about = data.about;
}
}
the problem is that the text is displayed, the picture is not displayed, and it cannot be displayed with the above three path degrees. What is the problem
?