u-cell title=会员姓名: + cardInfousername v-if=cardInfousername u-cell怎么使得渲染出来的是会员姓名: 雷电将军
可以在<u-cell>标签中使用插值语法,将会员姓名与固定文本拼接起来,如下所示:
<u-cell :title="`会员姓名:${cardInfo.username}`" v-if="cardInfo.username"></u-cell>
在上述代码中,使用了模板字符串(template string)${}来将会员姓名与固定文本拼接起来,从而实现渲染出会员姓名和固定文本的效果。
原文地址: https://www.cveoy.top/t/topic/iHkY 著作权归作者所有。请勿转载和采集!