Leanote's Blog
I love Leanote!
Toggle navigation
Leanote's Blog
Home
Chrome
Git
Linux
Windows
Others
工具大全
VsCode
Expo
Html
JavaScript
Npm
Node
Mock
React-Native
React
TypeScript
小程序
插件
正则
Dva
Ant-Design-React
Umi
Vue
Vux
Ant-Design-Vue
Http
Java
flutter
开发小工具
About Me
Archives
Tags
vue刷新当前路由
2021-07-14 02:24:29
17
0
0
admin
### 使用一个空白页来中转 ``` // refresh.vue <template> <div></div> </template> <script> export default { name: "refresh", data() { return {} }, beforeRouteEnter(to, from, next) { next(vm => { vm.$router.replace({ path: from.path, query: to.query }) }) } } </script> // router.vue { path: "/refresh", name: "refresh", component: () => import(/* webpackChunkName: "page" */ "@/components/refresh"), meta: { keepAlive: false, isTab: false, isAuth: false } } // main.js (如果需要设置所有的) router.beforeEach((to, from, next) => { if (from.path === to.path) { next({ path: "/refresh", query: to.query }) return } } ```
Pre:
Promise循环依次执行ajax
Next:
商品属性选择(包括库存和下架)
0
likes
17
Weibo
Wechat
Tencent Weibo
QQ Zone
RenRen
Submit
Sign in
to leave a comment.
No Leanote account?
Sign up now.
0
comments
More...
Table of content
No Leanote account? Sign up now.