import { createSSRApp } from "vue";
import App from "./App.vue";
import uviewPlus from 'uview-plus';
import { wComponents } from './w-components';
import { store } from './store';
import { useEnv } from "./env";
import { useUtil } from "./util";
import { useWebSocket } from "./WebSocket";

export function createApp() {
	const app = createSSRApp(App);
	app
		.use(store) //使用pinia数据仓库
		.use(useEnv) //使用自定义环境变量,绑定全局变量$env
		.use(uviewPlus) //使用uviewPlus,绑定全局变量$u
		.use(wComponents) //使用自定义组件库,绑定全局变量$w
		.use(useUtil) //使用自定义工具库
		.use(useWebSocket)
	return {
		app
	};
}

