页面对应的路由配置:
// 基础管理
path: "/main/base",
name: "base",
component: Template,
children: [
{
// 基础管理-"企业安全台账管理"
path: "/main/base/standard/standing_book",
name: "enterpriseStandard7",
component: enterpriseStandard,
},
{
// 基础管理-"政府监管检查管理"
path: "/main/base/standard/rectify",
name: "enterpriseStandard8",
component: enterpriseStandard,
},
{
// 基础管理-"企业安全制度管理"
path: "/main/base/standard/comany_institution",
name: "enterpriseStandard2",
component: enterpriseStandard,

在Vue.js项目中,当不同路由对应同一页面但需根据路由参数加载不同数据时,发现页面未重新加载导致请求失败。解决办法是在模板文件中添加key属性,以确保每次路由变化时组件重新渲染。
最低0.47元/天 解锁文章

被折叠的 条评论
为什么被折叠?



