1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- import { createSSRApp } from "vue";
- import App from "./App";
- import store from "./store"; // store
- import plugins from "./plugins"; // plugins
- import "./permission"; // permission
- import config from "@/config"; // config
- // 引入json导出组件
- import JsonExcel from "vue-json-excel";
- // 引入微信js-sdk
- // import jweixin from 'weixin-js-sdk'
- // 引入UI组件
- import uviewPlus from "@/uni_modules/uview-plus";
- import oaCalendar from "@/components/oa-calendar/uni-calendar";
- import oaTabbar from "@/components/oa-tabbar/index";
- import oaTimeLine from "@/components/oa-timeLine/index"
- import oaTimeLineItem from "@/components/oa-timeLine-item/index"
- import oaUpload from "@/components/oa-upload/index"
- import oaScroll from "@/components/oa-scroll/index"
- import oaTouch from "@/components/oa-touch/index"
- import oaDropdown from "@/components/oa-dropdown/index"
- import oaUpgrade from "@/components/oa-upgrade/index"
- import oaTransForm from "@/components/oa-transForm/index"
- import oaTtsAudio from "@/components/oa-ttsAudio/index"
- import oaWeather from "@/components/oa-weather/index"
- export function createApp() {
- const app = createSSRApp(App);
- //挂载全局组件
- app.component('oa-calendar', oaCalendar)
- app.component('oa-tabbar', oaTabbar)
- app.component('oa-timeLine', oaTimeLine)
- app.component('oa-timeLine-item', oaTimeLineItem)
- app.component('oa-upload', oaUpload)
- app.component('oa-scroll', oaScroll)
- app.component('oa-touch', oaTouch)
- app.component('oa-dropdown', oaDropdown)
- app.component('oa-upgrade', oaUpgrade)
- app.component('oa-transForm', oaTransForm)
- app.component('oa-ttsAudio', oaTtsAudio)
- app.component('oa-weather', oaWeather)
- // 挂载全局json导出
- app.component("downloadExcel", JsonExcel);
- // 添加全局变量
- app.provide("$store", store);
- app.config.globalProperties.$store = store;
- app.provide("$BASE_URL", config.baseUrl);
- app.config.globalProperties.$BASE_URL = config.baseUrl;
- app.provide("$websiteUrl", config.websiteUrl);
- app.config.globalProperties.$websiteUrl = config.websiteUrl;
- app
- .use(uviewPlus)
- .use(store)
- .use(plugins);
- return {
- app,
- };
- }
|