摘要:
图是百度来的 图有一处错误componentWillReceiveProps图上是错的 1 componentWillMount:在组件渲染之前执行2 componentDidMount:在组件渲染之后执行3 shouldComponentUpdate :返回true和false,true代表允许改
阅读全文
posted @ 2020-05-24 23:23
执候
阅读(160)
推荐(0)
摘要:
1条件判断与渲染 1 class ParentCom extends React.Component{ 2 constructor(props){ 3 super(props) 4 this.state = { 5 isLogin:true 6 } 7 } 8 render(){ 9 if(this
阅读全文
posted @ 2020-04-12 12:13
执候
阅读(788)
推荐(0)
摘要:
先说概念 react-router: 实现了路由的核心功能 react-router-dom: 基于react-router,加入了在浏览器运行环境下的一些功能,例如:Link组件,会渲染一个a标签,Link组件源码a标签行; BrowserRouter和HashRouter组件,前者使用pushS
阅读全文
posted @ 2019-12-08 17:06
执候
阅读(936)
推荐(0)
摘要:
基于create-react-app做的小demo 比较简单直接上代码 效果图
阅读全文
posted @ 2019-12-07 17:26
执候
阅读(227)
推荐(0)
摘要:
使用的是create-react-app@3.1.1版本首先安装 npm install create-react-app -g然后创建文件 create-react-app react-test进入文件cd react-test运行npm run eject让文件吧webpack相关配置暴露出来,
阅读全文
posted @ 2019-11-20 15:21
执候
阅读(1246)
推荐(0)
摘要:
react脚手架搭建 1先建一个文件夹如:react-cli-basic2 npm init 创建page.json文件 回车就好 文件夹就多了一个page.json 3 react必须装的插件react react-dom babelify babel-preset-es2015 babel-pr
阅读全文
posted @ 2019-09-20 11:23
执候
阅读(423)
推荐(0)
摘要:
没做处理之前的打包 首先第一步 优化resolve.modules配置 build->webpack.base.config.js 优化前写法 优化后 'src':resolve('src'), 'node_modules': resolve('node_modules'), var src = p
阅读全文
posted @ 2019-07-16 15:31
执候
阅读(248)
推荐(0)
摘要:
随着正则用的越来越普遍,今天正好有时间整理一下 https://baike.baidu.com/item/%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F/1700215?fr=aladdinhttps://deerchao.cn/tutorials/reg
阅读全文
posted @ 2019-05-24 10:09
执候
阅读(355)
推荐(0)
摘要:
先给一种原始的方法sessionStorage或者localStorage 先说一下实现原理: 比如分页,你从第2页进入详情页 返回为了方便用户体验,肯定最好能回到当前这一页 我用的分页是elementui的分页,可以在分页切换的时候把页码缓存下来 handleCurrentChange(val){
阅读全文
posted @ 2019-05-16 15:46
执候
阅读(30733)
推荐(3)
摘要:
需求:输入框只能输入正整数,不能输入小数,负数 elemntui <el-input placeholder="请输入对应积分(1-3个字符)" v-model.trim="typeItem.point" type="number" pattern="[0-9]*" :maxlength="3" @
阅读全文
posted @ 2019-05-08 18:15
执候
阅读(2579)
推荐(0)