How to use vue-i18n on data attribute

https://github.com/kazupon/vu.

You can use this in

html

{{ $t("message.hello") }}

so how do you assign it to a variable?

    data () {
        return {
        
          value: "$t("allQuestion")" //

        }
    }
Jun.30,2021

encountered the same method, which has been solved, but I don't know whether it is good or not:
bind data with computed:

// html

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

you can use this.$t. As soon as the relevant usage https://github.com/kazupon/vu. has been added to the document, it is estimated that gitbook will be recompiled in a day or two, and then you can go directly to the official documentation website to check it out.

var vm = new Vue({
  data() {
    return {
      a: this.$t('a')
    }
  }
})

example: https://jsfiddle.net/hr2aksy9/6/


how to traverse in data?



https://jsfiddle.net/likaiqia.


doesn't anyone consider computed?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3dfe4-4f040.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3dfe4-4f040.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?