-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
List-item 列表渲染及 From 表单问题 #266
Labels
enhancement
New feature or request
Comments
我也遇到问题1,同开启了Component2及push进数组
InputItem也是一样的问题
|
原来是 handleAddItem(){
let _list = this.data.list;
let nextId =_list.length;
let defaultItem = {id: (nextId+1), title:'new Item'+ (nextId+1), content:''};
_list.push(defaultItem);
this.setData({list : _list}); // 这里导致的
console.log('handleAddObject', this.data.list)
}, 改成以下就能跑了: handleAddItem(){
let _list = this.data.list;
let nextId =_list.length;
let defaultItem = {id: (nextId+1), title:'new Item' + (nextId+1), content:''};
this.setData({
['list['+ nextId +']'] : defaultItem // 改成这种写法就可以跑了
})
}, |
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
背景
1、List-item 在 Component2 【开启】的状态下,往数组中添加新数据会出现页面渲染失败问题。
2、From 表单在 Component2 【未开启】的状态下,会出现name绑定属性中的属性找不到。
期望
List-item 能追加新数据,并且不会出现页面渲染失败问题
思路
The text was updated successfully, but these errors were encountered: