摘要: // 类组件 class Person { // constructor是类中的构造器 // 每一个类中,都有一个构造器 // 作用 每当new这个类的时候,必然会先优先执行 构造器中的代码 constructor (name,age) { this.name =name this.age = ag 阅读全文
posted @ 2019-10-27 15:46 秋风渡明月 阅读(646) 评论(0) 推荐(0) 编辑
摘要: 效果: 阅读全文
posted @ 2019-10-27 15:28 秋风渡明月 阅读(157) 评论(0) 推荐(0) 编辑
摘要: const App = props => { let alerts = () => { alert(props.time) } let is = {color:props.color? "red" : "blue"} return {props.time},; } let Apps = ()=>{ return {arrTime.map(item => )}... 阅读全文
posted @ 2019-10-27 15:09 秋风渡明月 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 组件传参: 在父组件通过属性传入 类似Vue 在子组件中通过函数的参数接受 阅读全文
posted @ 2019-10-27 14:50 秋风渡明月 阅读(870) 评论(0) 推荐(0) 编辑
摘要: 函数组件的组成 函数体(返回jsx)+名字(首字母必须大写)+使用 阅读全文
posted @ 2019-10-27 14:35 秋风渡明月 阅读(1188) 评论(0) 推荐(0) 编辑