用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]')
            }
        ]
    }
},

 

Logo

前往低代码交流专区

更多推荐