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

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

computed 未生效問題

computed 未生效問題

慕工程0101907 2019-04-10 18:19:10
this.$store.state數(shù)據(jù)改變后, computed未生效, 困惑了很久, 不知道哪里出了問題...感謝您的閱讀和解答.1、computed    computed: {        msgInfo() {            for (var i in this.$store.state.msgList.groupMsg) {                if (this.$store.state.msgList.groupMsg[i].tid == this.$route.query.tid) {                    return this.$store.state.msgList.groupMsg[i]                }            }        }    },2、模板調(diào)用       <div class="row clearfix" v-for="item in msgInfo.msg" :key="item.mid">            <img :src="item.headerUrl" class="header">            <div class="content">                <div class="content-header" style="height:10px;">                    <p style="float:left;">{{item.fromname}}</p>                    <p style="float:right;">{{item.createtime}}</p>                </div>                <div class="clear"></div>                <p class="text" v-more>{{item.content}}</p>                <div class="content-footer">                    <p style="float:right;">--來自: {{item.groupname}}</p>                </div>                <div class="clear"></div>            </div>        </div>3、數(shù)據(jù)變更        var has = this.$store.state.msgList.groupMsg.some((item, index, array) => {            if(item.tid == data.tid){                this.$store.state.msgList.groupMsg[index].nexttime = data.create_time;                this.$store.state.msgList.groupMsg[index].msg.push({                    group : data.group,                    groupname : data.groupname,                    robotid : data.rid,                    mid : data.mid,                    from : data.from,                    fromname : data.fromname,                    content : data.content,                    headerUrl : "http://q.qlogo.cn/headimg_dl?bs=qq&dst_uin=" + data.from + "&fid=blog&spec=100",                    createtime : data.create_time                });                return true;            }        });
查看完整描述

2 回答

?
HUX布斯

TA貢獻(xiàn)1876條經(jīng)驗 獲得超6個贊

想要vue檢測到引用類型內(nèi)部的數(shù)據(jù)變化需要使用setdelete


查看完整回答
反對 回復(fù) 2019-05-19
  • 2 回答
  • 0 關(guān)注
  • 1676 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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