Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
596 views
in Technique[技术] by (71.8m points)

使用element ui中的el-checkbox-group动态绑定数组,循环出来的checkbox怎么点击不了?

<el-checkbox-group v-model="form.table_index" @change="handleChange">

<el-checkbox

v-for="itema in attrData"

:key="itema.id"

:label="itema.id"

>{{itema.column_name}}</el-checkbox>

</el-checkbox-group>



this.form.table_index = [];

attrData是这个
image.png

页面能显示出来,但是点击不了
image.png


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
v-model="form.table_index"

这里你绑定的是form对象的深层属性,vue这样绑定对象深层属性存在问题。
改为

:value="form.table_index" @input="inputEvent"

在inputEvent手动赋值form.table_index


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...