
本文共 1997 字,大约阅读时间需要 6 分钟。
���Vue.js������������������������������������������
������������������������������������������������������������������������������������������������������������������������������������������������Vue.js���������������������������������������������������������������������������������������������������������������������������������������
1. ������������������
������������������������������������������Vue���������������������������refresh
���������������������������������������������������������������������������������������������������
export function refresh(that) { that.$router.replace({ path: '/refresh', query: {} });}
������������������������������������������������������������/refresh
���������������������query
���������������������������������������������������������������������������������query
������������������������������
2. ������������������
��������������������������������������������������������������� setTimeout
���������������refresh
���������������������������������
let that = this;setTimeout(() => { refresh(that);}, 2000);
setTimeout
������������2000������������������refresh
������������������������������������������������������������������������������������this
������������������������������������������������������
3. ���������������
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
export default { beforeRouteEnter(to, from, next) { next(vm => { vm.$router.replace(from.path); }); }};
���������������������beforeRouteEnter
������������������������������������������������������������������������������vm.$router.replace(from.path)
���������������������������������������������������������������������������������������������
���������������������������������������������Vue.js���������������������������������������������������������������������������������������������������������������
发表评论
最新留言
关于作者
