在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML/ element-ui的計(jì)數(shù)器插件點(diǎn)擊無法增加和減少

element-ui的計(jì)數(shù)器插件點(diǎn)擊無法增加和減少

貼代碼先
<div v-for="item in currentQuestionTypeList">
        {{ item.name }}<el-input-number v-model="item.count" :min="0" :max="10" label=""></el-input-number>
</div>
由于設(shè)計(jì)需求,此計(jì)數(shù)器組件的個數(shù)需要跟后臺數(shù)據(jù)來確定有多少個;所以無法寫死v-model是某個變量;需要與獲取到的數(shù)據(jù)掛鉤,但是我這個寫法就導(dǎo)致無法點(diǎn)擊后增加減少的圖片描述

請問怎么解決呢
而在currentQuestionTypeList這個里面我也添加了count這個屬性

getQuestionType(subject_id) {
    var that = this;
    this.loading = true;
    api.getQuestionType(subject_id).then(response => {
        that.currentQuestionTypeList = response.data.datalist.filter(function(x){
            return ['3','39','7'].indexOf(x.id)>-1
        })
    that.currentQuestionTypeList.forEach(function(v,i){
        v['count']=0
    });
    //單選題==3   判斷題==39 多選題==7
    console.log(that.currentQuestionTypeList)
    })
}

這個是currentQuestionTypeList的數(shù)據(jù)
clipboard.png

回答
編輯回答
呆萌傻

是你的currentQuestionTypeList數(shù)組中的對象沒有這個屬性吧:count

2017年5月16日 21:28
編輯回答
話寡

樓主是怎么解決的,跟你遇到的問題一樣,抱緊樓主大腿

2017年7月22日 05:30