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

[vue] prop是怎么做验证的?可以设置默认值吗? #428

Open
haizhilin2013 opened this issue Jun 22, 2019 · 6 comments
Open

[vue] prop是怎么做验证的?可以设置默认值吗? #428

haizhilin2013 opened this issue Jun 22, 2019 · 6 comments
Labels
vue vue

Comments

@haizhilin2013
Copy link
Collaborator

[vue] prop是怎么做验证的?可以设置默认值吗?

@haizhilin2013 haizhilin2013 added the vue vue label Jun 22, 2019
@wenyejie
Copy link

validator, yes

@haizhilin2013
Copy link
Collaborator Author

@wenyejie 对吗?

@wenyejie
Copy link

@wenyejie 对吗?

你是想问内部实现逻辑嘛?

@haizhilin2013
Copy link
Collaborator Author

@wenyejie 你理解的prop是什么?不是问内部实现逻辑

@maozhuo123
Copy link

单个类型就用Number等基础类型,多个类型用数组,必填的话设置require为true,默认值的话设置default,对象和数组设置默认用工厂函数,自定义验证函数validator。

@vipbo
Copy link

vipbo commented Jul 24, 2019

type,isRequire,defatlt,validater

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

No branches or pull requests

4 participants