Skip to content
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

Closed
Chopinu opened this issue Sep 14, 2022 · 4 comments
Closed

List-item 列表渲染及 From 表单问题 #266

Chopinu opened this issue Sep 14, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@Chopinu
Copy link

Chopinu commented Sep 14, 2022

背景

1、List-item 在 Component2 【开启】的状态下,往数组中添加新数据会出现页面渲染失败问题。
2、From 表单在 Component2 【未开启】的状态下,会出现name绑定属性中的属性找不到。

期望

List-item 能追加新数据,并且不会出现页面渲染失败问题

思路

@Chopinu Chopinu added the enhancement New feature or request label Sep 14, 2022
@jiangslee
Copy link

jiangslee commented Sep 29, 2022

背景

1、List-item 在 Component2 【开启】的状态下,往数组中添加新数据会出现页面渲染失败问题。 2、From 表单在 Component2 【未开启】的状态下,会出现name绑定属性中的属性找不到。

期望

List-item 能追加新数据,并且不会出现页面渲染失败问题

思路

我也遇到问题1,同开启了Component2及push进数组

af-appx.worker.min.js:26 worker render components is not sync! can not find id from path: 1-2-2-2:/node_modules/antd-mini/es/List/ListItem/index
Please check your axml: 
    in /node_modules/antd-mini/es/List/ListItem/index
    in view
    in view
    in /node_modules/antd-mini/es/List/index
    in view
    in view

InputItem也是一样的问题

orker render components is not sync! can not find id from path: 1-2-3:/node_modules/antd-mini/es/InputItem/index
Please check your axml: 
    in /node_modules/antd-mini/es/InputItem/index
    in view
    in view
    in view

@jiangslee
Copy link

jiangslee commented Sep 29, 2022

背景

1、List-item 在 Component2 【开启】的状态下,往数组中添加新数据会出现页面渲染失败问题。 2、From 表单在 Component2 【未开启】的状态下,会出现name绑定属性中的属性找不到。

期望

List-item 能追加新数据,并且不会出现页面渲染失败问题

思路

我也遇到问题1,同开启了Component2及push进数组

af-appx.worker.min.js:26 worker render components is not sync! can not find id from path: 1-2-2-2:/node_modules/antd-mini/es/List/ListItem/index
Please check your axml: 
    in /node_modules/antd-mini/es/List/ListItem/index
    in view
    in view
    in /node_modules/antd-mini/es/List/index
    in view
    in view

InputItem也是一样的问题

orker render components is not sync! can not find id from path: 1-2-3:/node_modules/antd-mini/es/InputItem/index
Please check your axml: 
    in /node_modules/antd-mini/es/InputItem/index
    in view
    in view
    in view

原来是setData导致的问题

    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 // 改成这种写法就可以跑了
      })
    },

@wyj580231
Copy link
Collaborator

@jc9702507
Copy link
Collaborator

#305

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants