摘要: 父组件: <template> <el-button type="primary" plain @click="Newlyadded('addOrder')">新增</el-button> <Add ref="addOrder" v-if="addOrderVisible" :visible.syn 阅读全文
posted @ 2021-09-01 17:51 病阳阳 阅读(252) 评论(0) 推荐(0)
摘要: getNowTime() { var date = new Date(); year = date.getFullYear(); month = date.getMonth() + 1; var monthStr = month >= 10 ? month : "0" + month; day = 阅读全文
posted @ 2021-08-18 17:00 病阳阳 阅读(180) 评论(0) 推荐(0)
摘要: var sizeFlag;if(document.documentElement.clientWidth >= 300 && document.documentElement.clientWidth <= 360) { sizeFlag = 7.50;} else if(document.docum 阅读全文
posted @ 2021-08-18 14:21 病阳阳 阅读(20) 评论(0) 推荐(0)
摘要: seeShare(){ let routeUrl = this.$router.resolve({ path: "/share", query: {id:96} }); //let routeUrl = this.$router.resolve(`/share/${96}`) window.open 阅读全文
posted @ 2021-08-18 11:30 病阳阳 阅读(91) 评论(0) 推荐(0)
摘要: 安装 npm i react-router-dom 在app.js或者index.js中使用 class App extends Component { render() { return ( <BrowserRouter> <Switch>{/*只访问一个*/} <Route exact path 阅读全文
posted @ 2020-12-21 17:13 病阳阳 阅读(63) 评论(0) 推荐(0)
摘要: 前提是安装了npm和node npm或cnpm命令创建项目: cnpm install -g create-react-app >>( npm install -g create-react-app ) create-react-app my-app (my-app是你自己的项目名称 自定义) 创建 阅读全文
posted @ 2020-12-18 11:07 病阳阳 阅读(194) 评论(0) 推荐(0)
摘要: 渲染多个组件 function NumberList(props) { const numbers = props.numbers; const listItems = numbers.map((number) => //不写key会看到警告 a key should be provided for 阅读全文
posted @ 2020-12-16 15:59 病阳阳 阅读(77) 评论(0) 推荐(0)
摘要: 逻辑与运算符 && true && expression : 返回expression false && expression :忽略并跳过 三元运算 condition ? true : false 阻止组件渲染 : 给props传入一个bool值 如果为假render方法返回null 而不进行任 阅读全文
posted @ 2020-12-16 14:49 病阳阳 阅读(59) 评论(0) 推荐(0)
摘要: 传统HTML: <button onclick = "f1()"> Activate Lasers </button> React: <button onclick = {f1()}> Activate Lasers </button> 绑定this:==> onClick = {this.hand 阅读全文
posted @ 2020-12-15 17:56 病阳阳 阅读(85) 评论(0) 推荐(0)
摘要: 生命周期: mount(挂载) uunmount(卸载) componentDidMount() 组件渲染到DOM后运行 未完待续... 阅读全文
posted @ 2020-12-15 17:20 病阳阳 阅读(59) 评论(0) 推荐(0)