Giter Club home page Giter Club logo

Comments (1)

e1emeb0t avatar e1emeb0t commented on May 18, 2024

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

from element-react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.