第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

vue 雙向綁定失效

vue 雙向綁定失效

雙向綁定失效,效果是點(diǎn)擊html里面的 i 標(biāo)簽(位置請(qǐng)看注釋)觸發(fā)方法,將collapse-transition組件里的v-show屬性改為true,控制組件展開,問題是組件里有個(gè)me屬相,如果把頁(yè)面里的{{me}}刪掉的話,組件就無(wú)法展開(相對(duì)應(yīng)的v-show屬性已經(jīng)改為true,單頁(yè)面中display仍為node),加上就可以這是為什么?<style scoped>.transfer-box{    width: 500px;    >div{        width: 220px;        height: 400px;        border: 1px solid #c1c1c1;        position: relative;        font-size: 12px;        line-height: 30px;        .transfer-control-title{            height: 30px;            background: #e9e9e9;            line-height: 30px;            padding: 0 5px;            position: absolute;            width: 100%;            box-sizing: border-box;        }        .transfer-choose-box{            margin-top: 30px;            height: 361px;            overflow-y: auto;            .parent-muen{                >.parent-muen-item{                    .sub-muen{                        margin-left: 30px;                    }                }            }        }    }}methods: {      //根據(jù)生命周期里生成的不變量數(shù)組,切換菜單展開狀態(tài)      toggleSubCollapse(key){        this.me++;        this.showSubList['show'+key] = !this.showSubList['show'+key]      }  },  created() {      //對(duì)獲取的數(shù)據(jù)遍歷,生成控制列表展開的對(duì)象      Object.keys(this.industryList).forEach((val, index, arr)=>{         this.showSubList['show'+val] = false;      })  },  mounted() {        }};</script>
查看完整描述

1 回答

?
holdtom

TA貢獻(xiàn)1805條經(jīng)驗(yàn) 獲得超10個(gè)贊

難道不是this.showSubList['show'+val] = false;這動(dòng)態(tài)添加屬性的關(guān)系?

你改為下面的代碼試試


let temp = {}

Object.keys(this.industryList).forEach((val, index, arr)=>{

  temp['show'+val] = false;

})

this.showSubList = temp

至于為什么刪了me之后不生效了,我覺得是頁(yè)面中用到me的時(shí)候me值的改變剛好觸發(fā)了頁(yè)面數(shù)據(jù)的更新。


查看完整回答
反對(duì) 回復(fù) 2019-03-12
  • 1 回答
  • 0 關(guān)注
  • 463 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)