Giter Site home page Giter Site logo

Comments (14)

DiamondYuan avatar DiamondYuan commented on June 5, 2024

能写一个简答的复现 demo 吗? 我试了一下 navigateTo 没有报错。

from ant-design-mini.

luoxin59420 avatar luoxin59420 commented on June 5, 2024

先跳转到 表单页面赋值给表单,然后返回 再跳进去就报这个 Form "addItem" same name了,跳转api:dd.navigateTo({
url: /pages/index/view/index?id=${this.data.pageData.id},
success: () => {},
fail: () => {},
complete: () => {},
});

页面初始化有用到: form: new Form(),
handleRef(ref) {
this.form.addItem(ref)
},

from ant-design-mini.

DiamondYuan avatar DiamondYuan commented on June 5, 2024

先跳转到 表单页面赋值给表单,然后返回 再跳进去就报这个 Form "addItem" same name了,跳转api:dd.navigateTo({ url: /pages/index/view/index?id=${this.data.pageData.id}, success: () => {}, fail: () => {}, complete: () => {}, });

页面初始化有用到: form: new Form(), handleRef(ref) { this.form.addItem(ref) },

是不是多个页面用了同一个 form ?

同一个页面的 handleRef 应该只会被调用一次。

from ant-design-mini.

DiamondYuan avatar DiamondYuan commented on June 5, 2024

能建一个完整项目吗? 上面的例子我这边没办法复现

from ant-design-mini.

luoxin59420 avatar luoxin59420 commented on June 5, 2024

我怎么把项目给到你看呢 我这边每个页面都是单独的form

from ant-design-mini.

DiamondYuan avatar DiamondYuan commented on June 5, 2024

我怎么把项目给到你看呢 我这边每个页面都是单独的form

建一个空项目,然后写一个简单的 form ?

from ant-design-mini.

lianjianjie avatar lianjianjie commented on June 5, 2024

我也遇到了同样的问题,钉钉小程序,表单返回再次进入就会报错
image

from ant-design-mini.

lianjianjie avatar lianjianjie commented on June 5, 2024

@luoxin59420 请问你解决了吗,我这里也遇到了同样的问题

from ant-design-mini.

DiamondYuan avatar DiamondYuan commented on June 5, 2024

@luoxin59420 请问你解决了吗,我这里也遇到了同样的问题

写一个复现的 demo ?

from ant-design-mini.

lianjianjie avatar lianjianjie commented on June 5, 2024

@DiamondYuan 您看可以用吗
https://github.com/lianjianjie/test.git

from ant-design-mini.

luoxin59420 avatar luoxin59420 commented on June 5, 2024

已解决,但不佳;因为dd.navigateTo跳转到的页面没有被销毁,导致每次进入页面的时候都会执行form表单的handleRef,导致出现这个问题,可以通过:dd.redirectTo(跳转到应用内的某个指定页面,并关闭当前页面) 或者 dd.reLaunch(关闭所有页面)

from ant-design-mini.

lianjianjie avatar lianjianjie commented on June 5, 2024

@luoxin59420 感谢,和我的想法基本一样

from ant-design-mini.

11003 avatar 11003 commented on June 5, 2024

+1

from ant-design-mini.

DiamondYuan avatar DiamondYuan commented on June 5, 2024

form 的 item 是不支持重复添加的,所以如果页面没有销毁,再次访问就会报错。

onLoad() {
    this.form =  new Form();
  },

可以试试看这种写法

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.