import { createSSRApp } from "vue";
import App from "./App";
import store from "./store"; // store
import plugins from "./plugins"; // plugins
import "./permission"; // permission

// 引入json导出组件
import JsonExcel from "vue-json-excel";

// 引入UI组件
import uviewPlus from "@/uni_modules/uview-plus";

export function createApp() {
  const app = createSSRApp(App);

  //挂载全局组件

  

  // 挂载全局json导出
  app.component("downloadExcel", JsonExcel);
  // 添加全局变量
  app.provide("$store", store);
  app.config.globalProperties.$store = store;

  app
    .use(uviewPlus)
    .use(store)
    .use(plugins);

  return {
    app,
  };
}
