export default {
name: 'app',
computed: {
item () {
return this.serverData.dealInfo
}
},
data () {
return {
CDN_IMG_HOST: '//cdnimg.ydmap.com.cn',
serverData: {
dealInfo: {}
}
}
}
}
This code not work:
<img class="item-img" :src="`${((item.commonSales || {}).picUrl || [])[1] || `${CDN_IMG_HOST}/commonsales/0/`}58X58.gif`">
Picture url is wrong:
/$%20%7B%20%20%20%20%20%20%20%20%20%20CDN_IMG_HOST%20%20%20%20%20%20%20%20%7D%20%20%20%20%20%20%20%20/commonsales/%20%20%20%20%20%20%20%200%20/%2058X58.gif
This code work fine:
<img class="item-img" :src="`${(item.commonSales.picUrl || [])[1] || `${CDN_IMG_HOST}/commonsales/0/`}58X58.gif`">
vue-cli
new project created with https://github.com/vuejs-templates/webpack are work fine in both cases.