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

lxx #13

Open
computer-rookie-master opened this issue Nov 3, 2021 · 2 comments
Open

lxx #13

computer-rookie-master opened this issue Nov 3, 2021 · 2 comments
Milestone

Comments

@computer-rookie-master
Copy link
Contributor

No description provided.

@computer-rookie-master computer-rookie-master added this to the study diary milestone Nov 3, 2021
@Guiyuuu
Copy link

Guiyuuu commented Nov 3, 2021

react

  • React使用render()【渲染】,接收输入的数据并返回需要展示的内容。在组件中通过this.props在render()访问。

  • ReactDOM.render(属性1,属性2);

  • ReactDOM使用小驼峰命名法

  • 引入React:

    • React、ReactDOM、JSX(Bable转换成原生JS代码,在使用JSX语法时,需要设置type=“text/babel” 【<script src方法】注意需要保持联网正确,解决方法:下载文档。
  • 创建组件:

    • 类开头必须大写

      • class H extends React.Component{

        render(){
        return(

        Hello
        )}}

JSX简单了解

  • {}和“”只能选其一
  • 需要保证只有一个根节点
  • React.createElement()会预先执行一些检查

渲染

  • React元素是不可变对象,一旦被创建无法修改子元素或属性
  • 创建一个全新的元素来更新,并将其传入ReactDOM.render()

@Guiyuuu
Copy link

Guiyuuu commented Nov 4, 2021

基本组件等,可以在微信开发文档中更加详细了解组件的使用以及分类,以及框架。

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

2 participants