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
292 views
in Technique[技术] by (71.8m points)

vue.js v-for中v-model该如何获取checkbox的值?

效果如下:
clipboard.png

clipboard.png

clipboard.png

目前单选框可以获取value值,但是多选框只能获取到true或者false,而且只有一条。

clipboard.png

而且获取到的数据格式也不太理想,想请教下如何才能获取到每一项的选中项的值呢?


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

1 Answer

0 votes
by (71.8m points)

在你的list外包一层form 直接获取form数组的值即可。

参考http://element.eleme.io/#/zh-... 动态增减表单项。


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

...