Browse Source

master

master
邓宏 3 years ago
parent
commit
5f6d9758dd
  1. 4
      package.json
  2. 2
      src/App.vue
  3. 5
      src/router/index.js

4
package.json

@ -4,10 +4,10 @@
"version": "0.0.0",
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview"
"build": "vite build"
},
"dependencies": {
"element-plus": "^2.1.7",
"vue": "^3.2.25",
"vue-router": "^4.0.0-0",
"vuex": "^4.0.2"

2
src/App.vue

@ -6,7 +6,7 @@
<template>
<router-view v-slot="{Component}">
<keep-alive :include="['dhome','ddd']">
<keep-alive :include="['dhome','demo']">
<component :is="Component" :key="$route.path"/>
</keep-alive>
</router-view>

5
src/router/index.js

@ -2,7 +2,6 @@ import { createRouter, createWebHashHistory } from "vue-router";
import Home from "@/views/home.vue";
import { defineAsyncComponent, defineComponent } from "vue";
var b=defineAsyncComponent(async()=>await import("@/views/demo.vue").then(v=>({...v.default,name:'ddd'})))
const routes = [
{
path: "/",
@ -12,12 +11,12 @@ const routes = [
{
path: "/demo",
name: "demo",
component: b,
component: ()=>import('@/views/demo.vue').then(e=>({...e.default,name:"demo"})),
},
];
const router = createRouter({
history: createWebHashHistory(),
routes,
});
window.r=routes
export default router;
Loading…
Cancel
Save