准确的说是在循环中只要正确调用了item,wx:key就不起作用了,是哪里设置有问题吗?
<!–pages/test.wxml–>
<view class=“usermotto”>
<button bindtap=“add”>添加</button>
<button bindtap=“remove”>删除</button>
</view>
<form bindsubmit=“formSubmit”>
<block wx:for="{{personlist}}" wx:for-item=“person” wx:key=“id”>
<view>
<ul style='display:-webkit-flex;display:flex;flex-direction: column '>
<li><label style=‘display:inline-block’>姓名:</label><input style=‘display:inline-block’ type=“text” value=’{{person.name}}’ /></li>
<li><label style=‘display:inline-block’>手机号:</label><input style=‘display:inline-block’ type=“text” value=’{{person.mobile}}’ /></li>
</ul>
</view>
</block>
<view class=“usermotto”>
<button formType=“submit”>提交</button>
<button formType=“reset”>重置</button>
</view>
</form>