In nuxt.js: will an error be reported when src parses the value in data?


export default {
data: {

in

js

imgUrl:require(this.placeImg)

}
props: [

placeImg:{default: "~assets/img/3339.png"}

]
}

this won"t work. What it means on the Internet is that require can"t parse variables. Is there any way to solve this?

Mar.22,2021

export default {

props: {
    placeImg: require('~/assets/img/abc.png')
}
< H2 >} < / H2 >
Menu