layui/example/src/main.ts

29 lines
801 B
TypeScript
Raw Normal View History

2021-09-26 22:09:33 +00:00
import Layout from './App.vue'
2022-02-11 05:40:31 +00:00
import { App, createApp as _createApp } from 'vue'
2021-09-26 22:09:33 +00:00
import { createRouter } from './router/index'
import { Router } from 'vue-router'
2022-02-11 05:40:31 +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-29 18:39:19 +00:00
import LayAnchor from './components/LayAnchor.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
} {
2022-02-11 05:40:31 +00:00
const app = _createApp(Layout);
const router = createRouter();
2021-09-26 22:09:33 +00:00
app
2022-02-11 05:40:31 +00:00
.use(layui)
2021-09-26 22:09:33 +00:00
.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-29 18:39:19 +00:00
.component('LayAnchor',LayAnchor)
2021-09-26 22:09:33 +00:00
return { app, router }
2022-02-11 05:40:31 +00:00
}