上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页
摘要: 一,安装sass 1 npm i sass sass-loader --save 二,安装element主题生成工具 // 全局安装npm i element-theme --save // 安装主体工具,注意没全局装 npm i element-theme -D 三,安装chalk主题 1 npm 阅读全文
posted @ 2021-03-05 16:30 顺· 阅读(2474) 评论(0) 推荐(0) 编辑
摘要: 组件将要挂载 组件挂载完毕 组件将要更新 组件更新完毕 生命周期流程(旧) 1 import Children from './Children' 2 export default class Left extends Component { 3 constructor(props) { 4 sup 阅读全文
posted @ 2021-03-03 13:31 顺· 阅读(34) 评论(0) 推荐(0) 编辑
摘要: 使用柯里化: 1 state = { 2 username: "", 3 password: "", 4 }; 5 render() { 6 return ( 7 <div> 8 <form action="" onSubmit={this.handleSub}> 9 姓名: 10 {/*因为onc 阅读全文
posted @ 2021-03-02 23:05 顺· 阅读(61) 评论(0) 推荐(0) 编辑
摘要: 非受控组件:随用随取 1 render() { 2 return ( 3 <div> 4 <h1>非受控组件</h1> 5 <form action="" onSubmit={this.handleSub}> 6 姓名:<input ref={(e) => {this.username = e}} 阅读全文
posted @ 2021-03-02 22:22 顺· 阅读(54) 评论(0) 推荐(0) 编辑
摘要: https://zh-hans.reactjs.org/docs/refs-and-the-dom.html 字符串形式ref 1 <input ref="myinput" type="text" placeholder="字符串形式的ref" /> 2 <button onClick={this. 阅读全文
posted @ 2021-03-02 22:01 顺· 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 什么是prop-types?prop代表父组件传递过来的值,types代表类型。简单来说就是用来校验父组件传递过来值的类型 propTypes用来规范props必须满足的类型,如果验证不通过将会有warn提示。 React PropTypes的种类有 1 React.PropTypes.array 阅读全文
posted @ 2021-03-01 22:14 顺· 阅读(4740) 评论(0) 推荐(0) 编辑
摘要: https://www.jianshu.com/p/3935a80342a0 合并 对象/数组 let a = [1,2,3]; let b = [4,5,6]; let c = [...a,...b]; // [1,2,3,4,5,6] 浅拷贝对象/数组 用扩展运算符对数组或者对象进行拷贝时,只能 阅读全文
posted @ 2021-03-01 21:37 顺· 阅读(68) 评论(0) 推荐(0) 编辑
摘要: 类的理解 1 // 创建一个person类 2 class Person { 3 /* */ 4 // 构造器方法 5 constructor(name, age) { 6 // this指向 => 类的实例对象 7 this.name = name; 8 this.age = age; 9 } 1 阅读全文
posted @ 2021-02-24 22:52 顺· 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 一、style 利用 “[元素].style.[CSS属性名] = [属性值]” 的方法 1 var Box = document.getElementById('box') 2 Box.style.height = '100px' 3 Box.style.width = '100px' 4 Box 阅读全文
posted @ 2021-02-05 16:44 顺· 阅读(2275) 评论(0) 推荐(0) 编辑
摘要: 一,已知宽高 1 <style> 2 #box { 3 height: 400px; 4 width: 400px; 5 border: 1px solid grey; 6 position: relative; 7 } 8 .son { 9 height: 300px; 10 width: 300 阅读全文
posted @ 2021-02-05 16:24 顺· 阅读(200) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页