Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.4k views
in Technique[技术] by (71.8m points)

vue v-for中的:style怎么使用过滤器

我item.img,要在前面拼接一个地址,请问可以实现吗item.img|imgFormatter不行

    <div class="swiper-slide" :style="{backgroundImage: 'url(' + item.img + ')'}">
            <div class="text-c cm-content">

            </div>
    </div>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

如果是项目内的相对地址要用require


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...