layui/example/src/main.ts

32 lines
895 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'
2021-12-06 01:35:18 +00:00
import Layui from '../../src/index'
2021-09-26 22:09:33 +00:00
import LayCode from './components/LayCode.vue'
2021-10-06 15:22:30 +00:00
import LaySearch from './components/LaySearch.vue'
2021-11-07 07:55:08 +00:00
import LayTableBox from './components/LayTableBox.vue'
2021-12-15 16:00:45 +00:00
import LayComment from './components/LayComment.vue'
2021-11-16 01:35:18 +00:00
import './assets/css/index.css'
2021-09-26 22:09:33 +00:00
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-11-07 07:55:08 +00:00
.component('LayTableBox', LayTableBox)
2021-12-15 16:00:45 +00:00
.component('LayComment', LayComment)
2021-09-26 22:09:33 +00:00
.use(Layui)
return { app, router }
}