Files
ks-app-employment-service/main.js

44 lines
1.3 KiB
JavaScript
Raw Normal View History

2025-03-28 15:19:42 +08:00
import App from '@/App'
2024-11-08 11:55:23 +08:00
import * as Pinia from 'pinia'
2025-03-28 15:19:42 +08:00
import globalFunction from '@/common/globalFunction'
import '@/lib/string-similarity.min.js'
import similarityJobs from '@/utils/similarity_Job.js';
import NoBouncePage from '@/components/NoBouncePage/NoBouncePage.vue'
2025-04-16 14:24:06 +08:00
import MsgTips from '@/components/MsgTips/MsgTips.vue'
2025-04-10 10:59:25 +08:00
// import Tabbar from '@/components/tabbar/midell-box.vue'
2025-04-16 14:24:06 +08:00
// 自动导入 directives 目录下所有指令
const directives = import.meta.glob('./directives/*.js', {
eager: true
});
2025-03-29 11:51:48 +08:00
2024-11-08 11:55:23 +08:00
import {
2025-03-28 15:19:42 +08:00
createSSRApp,
2024-11-08 11:55:23 +08:00
} from 'vue'
2025-03-28 15:19:42 +08:00
// 全局组件
2024-11-08 11:55:23 +08:00
export function createApp() {
const app = createSSRApp(App)
2025-03-28 15:19:42 +08:00
app.component('NoBouncePage', NoBouncePage)
2025-04-16 14:24:06 +08:00
app.component('MsgTips', MsgTips)
2025-04-10 10:59:25 +08:00
// app.component('tabbar-custom', Tabbar)
2025-03-28 15:19:42 +08:00
2025-04-16 14:24:06 +08:00
for (const path in directives) {
const directiveModule = directives[path];
// 文件名作为指令名,./directives/fade.js => v-fade
const name = path.match(/\.\/directives\/(.*)\.js$/)[1];
app.directive(name, directiveModule.default);
}
2025-03-28 15:19:42 +08:00
app.provide('globalFunction', {
...globalFunction,
similarityJobs
});
2024-11-08 11:55:23 +08:00
app.provide('deviceInfo', globalFunction.getdeviceInfo());
2025-03-28 15:19:42 +08:00
app.use(Pinia.createPinia());
2024-11-08 11:55:23 +08:00
return {
app,
Pinia
}
}