摘要: 1.antd官网: https://ant.design/docs/react/introduce-cn 2、React中使用Antd 1、安装antd npm install antd --save / yarn add antd / cnpm install antd --save 2、在您的r 阅读全文
posted @ 2020-10-30 09:54 做个人把 阅读(2762) 评论(0) 推荐(0)
摘要: react动态路由传值 react-router-dom在浏览器中使用 react-router-native在开发手机原生应用中使用 --推荐使用react-navigation 下载npm i react-router-dom 引入对象:按需引入 HashRouter,BrowserRouter 阅读全文
posted @ 2020-10-29 18:13 做个人把 阅读(380) 评论(0) 推荐(0)
摘要: 1.构造函数 constructor constructor() { console.log('01构造函数'); } 2.组件将要挂载 componentWillMount //组件将要挂载的时候触发的生命周期函数 componentWillMount(){ console.log('02组件将要 阅读全文
posted @ 2020-10-29 16:41 做个人把 阅读(89) 评论(0) 推荐(0)
摘要: 1.父组件调用子组件的方法与数据: 父组件引入子组件Footer 在子组件加ref属性 父组件执行getFooter方法,调用子组件的run()方法 getFooter=()=>{ this.refs.footer.run(); alert(this.refs.footer.state.msg); 阅读全文
posted @ 2020-10-28 22:54 做个人把 阅读(177) 评论(0) 推荐(0)
摘要: 三种改变this指向的方法 1.在调用的时候使用bind方法 onClick={this.getData.bind(this)} 2.在constructor里面改变this指向 this.getData=this.getData.bind(this) 3.在方法上使用箭头函数 getData=() 阅读全文
posted @ 2020-10-28 19:26 做个人把 阅读(97) 评论(0) 推荐(0)
摘要: 方法一: 1.安装cnpm: npm install -g cnpm --registry=https://registry.npm.taobao.org 2.用yarn替代npm cnpm install -g yarn 3.安装脚手架 cnpm install -g create-react-a 阅读全文
posted @ 2020-10-27 21:57 做个人把 阅读(325) 评论(0) 推荐(0)
摘要: ** 这是后台版本检查** // /* 检查当前版本*/ static getVersionName(version){ if (uni.getSystemInfoSync().platform == 'other') { console.log("other") } else if (uni.ge 阅读全文
posted @ 2020-10-27 11:34 做个人把 阅读(146) 评论(0) 推荐(0)
摘要: vue在后台获取了一些标签筛选一些 有用的标签 vue里面数据data:isActiveLabel:["推荐","特价","热门","精品"];这是需要显示的标签:class="{'secItem':isActiveLabel.includes(items.lableName)}" class="i 阅读全文
posted @ 2020-10-11 21:07 做个人把 阅读(535) 评论(0) 推荐(0)
摘要: 在Vue的内容里面 {{data|capitalize}} 加 | 过滤需要匹配的数据 然后写 filters:{ capitalize:function(value){ if(!value){ return ' ' } value = value.toString() return value.s 阅读全文
posted @ 2020-10-11 17:06 做个人把 阅读(3592) 评论(0) 推荐(0)
摘要: 1.首先再methods里面写一个方法 signKeyword (val) { let keyword = this.title //搜索的值 if (val.indexOf(keyword) !== -1) { return val.replace(keyword, `<font color='# 阅读全文
posted @ 2020-10-09 17:39 做个人把 阅读(615) 评论(0) 推荐(0)