vue2.0的数据改变了,怎么视图没变化
发布于 8 年前 作者 vue-rbb 4892 次浏览 来自 问答
粉丝福利 : 关注VUE中文社区公众号,回复视频领取粉丝福利

export default { name: ‘app’, data:function () { return { guss_icon_active:“guss_icon_active”, guss_text_active:“guss_text_active”, shop_icon_active:"", shop_text_active:"", pers_icon_active:"", pers_text_active:"" } }, mounted:function(){ var oTaBottom = document.getElementById(“tab_bottom”); if(Common.bottomTab){ oTaBottom.style.display = ‘flex’; }else{ oTaBottom.style.display = ‘none’; } }, updated:function(){ var oTaBottom = document.getElementById(“tab_bottom”); if(Common.bottomTab){ oTaBottom.style.display = ‘flex’; }else{ oTaBottom.style.display = ‘none’; } changeBottom(this); console.log(this.shop_text_active) } } function changeBottom(that){ that.guss_icon_active = “”; that.guss_text_active = “”; that.shop_text_active = “”; that.shop_icon_active = “”; that.pers_icon_active = “”; that.pers_text_active = “”; if(that.$router.history.current.fullPath == ‘/guss/luck’){ that.guss_icon_active = “guss_icon_active”; that.guss_text_active = “guss_text_active”; } if(that.$router.history.current.fullPath == ‘/shop’){ that.shop_text_active = “shop_text_active”; that.shop_icon_active = “shop_icon_active”; } if(that.$router.history.current.fullPath == ‘/pers’){ that.pers_icon_active = “pers_icon_active”; that.pers_text_active = “pers_text_active”; } } 我console.log()能显示数据已绑定,可是视图中绑定的数据没显示,求解啊!!!!!!!

回到顶部