the code is as follows:
html:
<div class = "a">
<span :class="{active: isTable == "a"}" @click = "table("a")">{{ $t("EOSGame.shaiZi.part1") }}</span>
<span :class="{active: isTable == "b"}" @click = "table("b")">{{ $t("EOSGame.shaiZi.part2") }}</span>
</div>
<div class = "thead">
<span v-for = "thead in theads" :key = "thead.name">{{thead.name}}</span>
</div>
js:
export default {
data () {
return {
theads: [
{name: this.$t("EOSGame.shaiZi.part3")},
{name: this.$t("EOSGame.shaiZi.part4")},
{name: this.$t("EOSGame.shaiZi.part5")},
{name: this.$t("EOSGame.shaiZi.part6")},
],
}
}
}
among them, both part1 and part2 can switch normally in real time by clicking the button, but the one in v-for will not change, but the language will be changed if the page is refreshed.
what is the reason? How to make the theads can also switch between Chinese and English in real time?