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

希望InputNumber的change回调可以加上oldValue参数 #1682

Closed
Tickly opened this issue Dec 11, 2016 · 1 comment
Closed

希望InputNumber的change回调可以加上oldValue参数 #1682

Tickly opened this issue Dec 11, 2016 · 1 comment

Comments

@Tickly
Copy link

Tickly commented Dec 11, 2016

ElementUI version

1.0.5

OS/Browers version

macOS/Chrome 53

Vue version

2.1.0

Reproduction Link

Steps to reproduce

What is Expected?

希望在InputNumber的回调change里面可以再加上一个之前的值的参数,即 change(oldValue,newValue)
因为有时候需要验证新的值是否被允许,但又不能通过min跟max去限制。
这样在change里面我可以根据newValue去判断是否符合要求,不符合我可以重新设置为oldValue

What is actually happening?

@flyingzl
Copy link

两种方法,直接将el-input放在el-form里面,设置校验规则。再者就是如果你想获取old值, 直接watch吧

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

No branches or pull requests

3 participants