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

64 lines
2.2 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';
2025-09-29 11:53:10 +08:00
import config from '@/config.js';
2025-05-13 11:10:38 +08:00
// 组件
import AppLayout from './components/AppLayout/AppLayout.vue';
import Empty from './components/empty/empty.vue';
2025-03-28 15:19:42 +08:00
import NoBouncePage from '@/components/NoBouncePage/NoBouncePage.vue'
2025-04-16 14:24:06 +08:00
import MsgTips from '@/components/MsgTips/MsgTips.vue'
2025-05-13 11:10:38 +08:00
import SelectPopup from '@/components/selectPopup/selectPopup.vue'
import SelectPopupPlugin from '@/components/selectPopup/selectPopupPlugin';
import RenderJobs from '@/components/renderJobs/renderJobs.vue';
import RenderCompanys from '@/components/renderCompanys/renderCompanys.vue';
2025-10-20 16:15:29 +08:00
// iconfont.css 已在 App.vue 中通过 @import 引入,无需在此处重复引入
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-10-20 11:05:11 +08:00
// const foldFeature = window.visualViewport && 'segments' in window.visualViewport
// console.log('是否支持多段屏幕:', foldFeature)
2025-05-15 14:17:51 +08:00
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
2025-05-13 11:10:38 +08:00
app.component('AppLayout', AppLayout)
app.component('Empty', Empty)
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-05-13 11:10:38 +08:00
app.component('SelectPopup', SelectPopup)
app.component('RenderJobs', RenderJobs)
app.component('RenderCompanys', RenderCompanys)
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,
2025-09-29 11:53:10 +08:00
similarityJobs,
config
2025-03-28 15:19:42 +08:00
});
2024-11-08 11:55:23 +08:00
app.provide('deviceInfo', globalFunction.getdeviceInfo());
2025-03-28 15:19:42 +08:00
2025-05-13 11:10:38 +08:00
app.use(SelectPopupPlugin);
2025-03-28 15:19:42 +08:00
app.use(Pinia.createPinia());
2025-05-13 11:10:38 +08:00
2024-11-08 11:55:23 +08:00
return {
app,
Pinia
}
}