自定义指令

This commit is contained in:
X1627315083@163.com
2026-05-14 14:55:42 +08:00
parent 281d9e9481
commit c48d2091cf
8 changed files with 132 additions and 8 deletions

View File

@@ -4,11 +4,12 @@ import { routes } from './routes'
import './style.css'
import directives from './directives/index'
// 注册指令
export const createApp = ViteSSG(App, {
routes,
base: import.meta.env.BASE_URL,
}, ({ app }) => {
app.use(directives)
})
routes,
base: import.meta.env.BASE_URL,
},
({ app, router, routes, isClient, initialState }) => {
// 注册全局指令
app.use(directives)
}
)