index.js 496 B

123456789101112131415161718192021
  1. /** 用于刷新的路由组件 */
  2. import { setRouteReload } from '@/utils/page-tab-util';
  3. export default {
  4. name: 'RedirectLayout',
  5. created() {
  6. const { params, query } = this.$route;
  7. const from = Array.isArray(params.path)
  8. ? params.path.join('/')
  9. : params.path;
  10. const path = '/' + from;
  11. setTimeout(() => {
  12. setRouteReload(null).then(() => {
  13. this.$router.replace({ path, query });
  14. });
  15. }, 100);
  16. },
  17. render(h) {
  18. return h('div');
  19. }
  20. };