按照官方设置写的路由,卡在了Cannot read property 'matched' of undefined这个错误问题,查了很多资料才知道,有两上命名是不能改动的,route与router; 在目录新建了文件router.js import Vue from 'vue' import vue ...
分类:
其他好文 时间:
2021-06-07 20:35:33
阅读次数:
0
我们想在reudx代码间插入想要做的逻辑,其实就是中间件。 1.基本做法(假设已经配置好react-redux也就是store/index,addAction和subAction是action逻辑) 这样做简单但是调用起来很复杂 2.封装函数 3.在函数的基础上修改原有的dispatch 这就不会影 ...
分类:
其他好文 时间:
2021-06-06 19:47:41
阅读次数:
0
####出现错误 提示信息: router.beforeEach((to, from, next) => { if (!storage.getItem('userInfo')) { console.log('error') next({ path: '/login' }) } else { cons ...
分类:
其他好文 时间:
2021-06-06 19:32:40
阅读次数:
0
Path '\react-native-safe-area-context\android\build\intermediates\compiled_local_resources\debug\out' is not a readable directory. 解决: 按照目录手动新建文件夹 ...
分类:
移动开发 时间:
2021-06-04 19:43:18
阅读次数:
0
如图,将promise设为一个全局对象,然后在生命周期内更改它的值,如果在组件要卸载时还时Pending状态,就用Promise.race()方法,直接传入一个Promise.reject()与它竞速,那么它就不会继续被执行。 ...
分类:
其他好文 时间:
2021-06-04 19:26:28
阅读次数:
0
1.路由传值: 传值:this.$router.push({ path: '/a', query: { id:1, age:18 } }) //如点击时触发 接收:this.$route.query.id || this.$route.query.age 2.父组件找子组件拿值及其方法: 父: im ...
分类:
其他好文 时间:
2021-06-04 19:08:41
阅读次数:
0
一、什么是导航 导航就是路由正在发生变化 二、导航守卫、路由守卫、路由的钩子函数 路由发生变化时自动触发的一些函数 三、守卫有哪些 全局守卫(通过new Router出来的实例进行使用,在router/index.js中进行使用) 全局前置守卫:beforeEach() beforeEach((to ...
分类:
其他好文 时间:
2021-06-04 19:03:33
阅读次数:
0
1.返回上一页 this.$router.go(-1) 2.返回上一页的指定页面 this.$router.push({ path: '/dashboard' }) ...
分类:
其他好文 时间:
2021-06-04 18:46:52
阅读次数:
0
1. 我们在 React class Component 绑定事件时,经常会通过 bind(this) 来绑定事件 class Home extends React.Component{ constructor( props ){ super( props ); } handleClick(even ...
分类:
其他好文 时间:
2021-06-03 18:04:10
阅读次数:
0
1、React组件生命周期 https://react.docschina.org/docs/react-component.html#shouldcomponentupdate 2、生命周期图谱作为速查表:如下图 https://projects.wojtekmaj.pl/react-lifecy ...
分类:
其他好文 时间:
2021-06-03 18:00:52
阅读次数:
0