How to implement dynamic :src in Vue.js?
P粉937769356
P粉937769356 2023-09-16 09:38:42
0
1
527

I wish to dynamically render a v-vor image with v-for image src using v-bind:src. Although the images directory seems to be correct (but how do I check that?) and the other array keys are displayed, I don't see the icons in the template.

structure: src - assets // 图像内部 -components // 组件内部    
{{benefit.content}}
data() { return { benefits: [ { icon: '../assets/benefits-icon.svg', //不显示 alt: 'benefits', //正常显示 title: 'plain text', //正常显示 content: 'plain text' //正常显示 }, ] } }

P粉937769356
P粉937769356

reply all (1)
P粉310754094

Try to change this code

1. 
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!