Comments (14)
能写一个简答的复现 demo 吗? 我试了一下 navigateTo 没有报错。
from ant-design-mini.
先跳转到 表单页面赋值给表单,然后返回 再跳进去就报这个 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.
先跳转到 表单页面赋值给表单,然后返回 再跳进去就报这个 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.
能建一个完整项目吗? 上面的例子我这边没办法复现
from ant-design-mini.
我怎么把项目给到你看呢 我这边每个页面都是单独的form
from ant-design-mini.
我怎么把项目给到你看呢 我这边每个页面都是单独的form
建一个空项目,然后写一个简单的 form ?
from ant-design-mini.
from ant-design-mini.
@luoxin59420 请问你解决了吗,我这里也遇到了同样的问题
from ant-design-mini.
@luoxin59420 请问你解决了吗,我这里也遇到了同样的问题
写一个复现的 demo ?
from ant-design-mini.
@DiamondYuan 您看可以用吗
https://github.com/lianjianjie/test.git
from ant-design-mini.
已解决,但不佳;因为dd.navigateTo跳转到的页面没有被销毁,导致每次进入页面的时候都会执行form表单的handleRef,导致出现这个问题,可以通过:dd.redirectTo(跳转到应用内的某个指定页面,并关闭当前页面) 或者 dd.reLaunch(关闭所有页面)
from ant-design-mini.
@luoxin59420 感谢,和我的想法基本一样
from ant-design-mini.
+1
from ant-design-mini.
form 的 item 是不支持重复添加的,所以如果页面没有销毁,再次访问就会报错。
onLoad() {
this.form = new Form();
},
可以试试看这种写法
from ant-design-mini.
Related Issues (20)
- Radio组件onChange只触发一次之后就不触发了 HOT 1
- 自定义上传组件,我ref加载了但是就是获取不到值是怎么回事?
- 小程序版tabbar增加Switchtab后切换异常 HOT 4
- Modal 在微信小程序里打开关闭没有过渡动画 HOT 1
- 自定义表单组件如何设置默认值? HOT 5
- Picker支持visible属性,DatePicker也希望支持
- Modal 组件在微信小程序下点击遮罩报错
- ant-swipe-action:小程序中使用页面无法上下滑动 HOT 1
- DatePicker组件onVisibleChange事件参数未适配微信
- tabs标签无法切换 HOT 1
- form-picker 可以支持多选吗 HOT 1
- uniapp中 form-input 没有执行 handleRef HOT 2
- 微信小程序下是否还不兼容skyline模式
- uniapp 中 ant-form-input 触发 confirm 事件报错
- 表单组件的slot可以把当前内容当作scope传进去
- antd-mini 的Slider 滑块,在小程序和插件上表现不一致,小程序的能正常滑动,插件的不可以。
- 【Tabs】scroll-view: property [type] is required, but not set..... HOT 5
- ant-date-picker value值指定后。再清除deal_end为空是 前端数据无法清空 HOT 1
- 【微信小程序】form-stepper 如果使用键盘输入 没办法触发form表单的onValuesChange HOT 1
- notice-bar 微信适配的 icon 插槽丢失
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ant-design-mini.