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

组件接口说明与Demo Code 模版 #2

Closed
rlog opened this issue Oct 26, 2016 · 1 comment
Closed

组件接口说明与Demo Code 模版 #2

rlog opened this issue Oct 26, 2016 · 1 comment
Milestone

Comments

@rlog
Copy link
Contributor

rlog commented Oct 26, 2016

No description provided.

@rlog rlog modified the milestone: v1.0.0 Oct 26, 2016
@e1emeb0t
Copy link
Contributor

e1emeb0t commented Oct 26, 2016

Component

为了保持组件的可控性, 所有自定义组件都需要继承于此Component, 而不是React.Component.

  • 属性
    • className [String], 可以将className附加到组件的根元素的class上.
    • style [Object], 可以将style附加到组件的根元素的style上.
  • 方法
    • classNames(className, ..., className), 参数类型参照[1], 返回类型为String.

View

  • 属性
    • if [any], Vue中的v-if的实现, 参考[2].
    • show [any], Vue的v-show的实现, 参考[3].
    • transition [String], Vue的transition的实现, 参考[4].

注意: React.Children.count(props.children) === 1

References

  1. https://github.com/JedWatson/classnames
  2. https://vuejs.org/guide/conditional.html#v-if
  3. https://vuejs.org/guide/conditional.html#v-show
  4. https://vuejs.org/guide/transitions.html#Transitioning-Single-Elements-Components

@e1emeb0t e1emeb0t self-assigned this Oct 26, 2016
@ElemeFE ElemeFE locked and limited conversation to collaborators Apr 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants