-
Notifications
You must be signed in to change notification settings - Fork 32
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
关于组件接口名称和文件合并 #8
Comments
为啥需要interface? |
|
没有强制处理,对外靠文档注释来标识 |
私有方法还是通过闭包来解决吧,虽然规范没有作要求 私有属性规范要求是下划线开头的,现有代码和单测要整理一下 |
同意私有方法用闭包解决,这样在控制台打印 instance.prototype 就清楚多了,不用看文档就知道该用哪个 我觉得外部常用的属性应该尽量通过 getter 方法提供,不要通过 instance.xx 的形式使用,比如 Select 就是 select.getValue() 而不会直接去读 select.value |
私有方法用闭包的缺点是 |
@otakustay 我觉得闭包函数应该传参数,而不是call/apply,因为 this 无法压缩成一个字母,倒不如直接点 fun(instance, arg1, arg2, ...) |
今天和 @jinzhubaofu @windtalkers 当面沟通,结论如下:
|
_
开头,并补充在规范上,提醒开发者不要调用下划线开头的私有方法;或者,提供一个interface
方法,指定哪些方法可以公开:lib
和Control
能否合并?仅仅因为可以在使用中减少一个请求 :)大家看下呢?
The text was updated successfully, but these errors were encountered: