vigilancia del reloj debe ser monitoreado:
属性值
, es decir, eldata
valor
caso
data () {
return {
language: ''
}
},
methods: {
handleSetLanguage (lang) {
this.$i18n.locale = lang;
this.language = lang;
localStorage.setItem("lang", lang);
}
},
watch: {
language: {
handler (val) {
console.log(val, '改变了');
if (val) {
this.menuList = [{
title: this.$t('navTop.aboutAllianceChain'),
active: true,
},
{
title: this.$t('navTop.metaUniverseMerchantAlliance'),
active: false,
},
{
title: this.$t('navTop.nftTradingPlatform'),
active: false,
},
{
title: this.$t('navTop.projectCommunity'),
active: false,
},
{
title: this.$t('navTop.newsAnnouncement'),
active: false,
},
{
title: this.$t('navTop.buyDag'),
active: false,
},
{
title: this.$t('navTop.purchaseGenesisNode'),
active: false,
},]
}
},
immediate: true // 代表进入页面首先执行
}
},
Si siente que el artículo es bueno, recuerde prestar atención, preste atención y recójalo. Corríjame si hay algún error. Si necesita reimprimir, indique la fuente, ¡gracias! ! !