Giter Site home page Giter Site logo

Comments (4)

jiangslee avatar jiangslee commented on May 22, 2024

背景

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

from ant-design-mini.

jiangslee avatar jiangslee commented on May 22, 2024

背景

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

from ant-design-mini.

wyj580231 avatar wyj580231 commented on May 22, 2024

https://mini.ant.design/components/form

from ant-design-mini.

jc9702507 avatar jc9702507 commented on May 22, 2024

#305

from ant-design-mini.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.