# console **Repository Path**: dansj/console ## Basic Information - **Project Name**: console - **Description**: console控制台页面 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2024-06-11 - **Last Updated**: 2025-10-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### 修改源码,keepalive 手动透传 removeKeepalive 方法 #### 1.修改单个文件 ``` 修改项目下的\node_modules\.pnpm\@vue+runtime-core@3.5.3\node_modules\@vue\runtime-core\dist\runtime-core.esm-bundler.js文件 import { keepalive } from "@/utils/keepalive" 在KeepAliveImpl方法的setup最底下添加 keepalive(sharedContext,pruneCacheEntry,keys) ``` #### 2.修改模块并配置到项目中 1) 复制 node_modules 下的@vue/runtime-core 模块代码 2) 修改第一个方法中的文件 3) 修改 vite.config.js,在 defineConfig 的 resolve 添加配置 ```js resolve: { extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'], alias: { '@': fileURLToPath(new URL('./src', import.meta.url)), '@usehook': fileURLToPath(new URL('./src/utils/vueuseHook', import.meta.url)), "@vue/runtime-core": fileURLToPath(new URL('./src/sourceCode/runtime-core', import.meta.url)) }, dedupe: ['vue'], }, ``` 4) 单独安装@vue 需要的模块 ``` pnpm install @vue/reactivity pnpm install @vue/shared ``` 5) @vue/runtime-core 的 dist 模块可能会被 git 忽略,可以把 dist 的文件拖到外面目录,然后修改 package.json,去掉所有的 dist 6) 配置完之后清除 node_modules 下的.vite 文件夹,然后重新运行项目