vue-i18n 怎么用在data属性上
用computed绑定数据:<li v-for="(item, index) in stepLists"><img :src="item.img" alt=""><div class="img-cover"><div cl
·
用computed绑定数据:
<li v-for="(item, index) in stepLists">
<img :src="item.img" alt="">
<div class="img-cover">
<div class="step-title">{{$t('lang.step')}} {{index + 1}}</div>
<div class="step-dec">
{{item.stepDec}}
</div>
</div>
</li>
//js
computed: {
stepLists() {
return [
{
img: require('../assets/img/home/step1_pic.png'),
stepDec: this.$t('lang.homePage.stepLists[0]')
},
{
img: require('../assets/img/home/step2_pic.png'),
stepDec: this.$t('lang.homePage.stepLists[1]')
}
]
}
},
更多推荐
已为社区贡献1条内容
所有评论(0)