在开发过程中遇到一个问题,对一个动态对象数组(可以删或者添加数组项)进行repeat生成一个输入框,如下图的情况:对象的代码片段如下:<ul class="l-form-set"> <li class="l-form-item" ms-repeat="stop_trouble_infos"> <input type="text" ms-widget="textbox" ms-duplex="el.trouble_stop_name" data-textbox-suggest="fetchStopInfo" data-textbox-suggest-onchange="stopChanged"/> <button type="button" class="ui-btn ui-btn-blue" ms-click="addQuestionStop">添加</button> <button type="button" ms-if="info.stop_trouble_infos.length>1" class="ui-btn ui-btn-cancel" ms-click="delQuestionStop">删除</button> </li> </ul>现要监控每个输入框的输入值来实现不同的业务逻辑,如根据该输入值的不同,来更新该输入框绑定值所在对象的其他属性,例如:{stop: '', stopId: ""}输入框绑定的stop值改变,来动态改变stopId等类似的情况;那么问题来了,avalon只能监控数组的length长度,如何监控对象数组中某个对象中属性,如上列的stop?
添加回答
举报
0/150
提交
取消