refactor(router): 重命名路由插件文件并更新类型定义
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
import { autoAnimatePlugin } from '@formkit/auto-animate/vue';
|
||||
import { createHead } from '@unhead/vue/client';
|
||||
|
||||
export function install({ app }: { app: import('vue').App<Element> }) {
|
||||
app.config.globalProperties.__DEV__ = __DEV__;
|
||||
|
||||
app.use(autoAnimatePlugin); // v-auto-animate="{ duration: 100 }"
|
||||
|
||||
app.use(createHead());
|
||||
app.config.errorHandler = (error, instance, info) => {
|
||||
console.error('Global error:', error);
|
||||
console.error('Component:', instance);
|
||||
@@ -64,7 +64,9 @@ declare module 'vue-router' {
|
||||
|
||||
export { router, setupLayoutsResult };
|
||||
export { createGetRoutes } from 'virtual:meta-layouts';
|
||||
export type RouteLocalizationFlags = Record<keyof RouteNamedMap, string>;
|
||||
declare global {
|
||||
type PageTitleLocalizations = Record<keyof RouteNamedMap, string>;
|
||||
}
|
||||
|
||||
if (__DEV__) Object.assign(globalThis, { router });
|
||||
// This will update routes at runtime without reloading the page
|
||||
5
src/plugins/10.formkit-auto-animate.ts
Normal file
5
src/plugins/10.formkit-auto-animate.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { autoAnimatePlugin } from '@formkit/auto-animate/vue';
|
||||
|
||||
export function install({ app }: { app: import('vue').App<Element> }) {
|
||||
app.use(autoAnimatePlugin); // v-auto-animate="{ duration: 100 }"
|
||||
}
|
||||
5
src/plugins/10.unhead.ts
Normal file
5
src/plugins/10.unhead.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { createHead } from '@unhead/vue/client';
|
||||
|
||||
export function install({ app }: { app: import('vue').App<Element> }) {
|
||||
app.use(createHead());
|
||||
}
|
||||
Reference in New Issue
Block a user