layui/docs/src/main.ts

28 lines
695 B
TypeScript
Raw Normal View History

2021-09-26 22:09:33 +00:00
import Layout from './App.vue'
import { App, createApp as _createApp, createSSRApp } from 'vue'
import { createRouter } from './router/index'
import { Router } from 'vue-router'
import Layui from '/@src/index'
import LayCode from './components/LayCode.vue'
2021-10-06 15:22:30 +00:00
import LaySearch from './components/LaySearch.vue'
2021-09-26 22:09:33 +00:00
import './styles/index.css'
export function createApp(): {
app: App<Element>
router: Router
} {
const app =
import.meta.env.MODE === 'production'
? createSSRApp(Layout)
: _createApp(Layout)
const router = createRouter()
app
.use(router)
.component('LayCode', LayCode)
2021-10-06 15:22:30 +00:00
.component('LaySearch', LaySearch)
2021-09-26 22:09:33 +00:00
.use(Layui)
return { app, router }
}