vue3项目嵌入到iframe 页面刷新报404问题

刷新报404问题主要是 路由模式是histioy , 要改为hash 模式

 

import { createWebHistory, createWebHashHistory,createRouter, RouteRecordRaw } from 'vue-router';
 
 路由配置文件由 createWebHistory 改为 createWebHashHistory
 
const router = createRouter({
  history: createWebHashHistory(),
  routes,
  });
 
获取携带的参数
const str= window.location.search||window.location.hash
posted @ 2024-05-15 17:39  cielw  阅读(478)  评论(0)    收藏  举报