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

如何向FormPreview组件buttons中的onButtonClick事件传参呢 #1123

Closed
webKity opened this issue Mar 22, 2017 · 6 comments
Closed

如何向FormPreview组件buttons中的onButtonClick事件传参呢 #1123

webKity opened this issue Mar 22, 2017 · 6 comments

Comments

@webKity
Copy link

webKity commented Mar 22, 2017

2.1.0

Android and iOS

Android and iOS

Expected behavior and actual behavior.

如何向FormPreview组件buttons中的onButtonClick事件传参呢

Steps to reproduce the problem

@airyland
Copy link
Owner

不知道你想实现什么,具体说明下吧。

@webKity
Copy link
Author

webKity commented Mar 22, 2017

假如我有这样一个使用情景:我有个订单列表,展示形式是FormPreview,当我点击FormPreview的button的时候跳转到相应订单的详情页面,这样的话,我就需要在点击的时候传递给onButtonClick回调函数一个参数ID,但是目前咱们的这个组件是不支持传参的,我现在目前为了满足业务只能是在源码中加了一个props,用来接收这个ID参数

@fengmuyan
Copy link

我也遇到这个问题,有点不灵活

@yinjianfeng
Copy link

yinjianfeng commented Feb 24, 2019

可以绑定name属性的值。
<form-preview :header-label="" :header-value="" :body-items="" :footer-buttons="button" :name="bindingValue"></form-preview>
然后在onButtonClick里可以直接拿到这个值

@fengmuyan
Copy link

传参数的话用 计算属性返回闭包函数其实更简单,有没有办法可以替代按钮的点击时间,自己写一些逻辑

@Accour
Copy link

Accour commented May 11, 2020

在form-preview中绑定name值,然后在button数组中调用:onButtonClick: (name) => {}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants