layui/src/index.ts

57 lines
1.2 KiB
TypeScript
Raw Normal View History

2021-09-27 06:09:33 +08:00
import type { App } from 'vue'
import type { IDefineComponent, InstallOptions } from './module/type/index'
import "./css/layui.css";
import LayRadio from './module/radio/index'
import LayButton from './module/button/index'
import LayIcon from './module/icon/index'
2021-09-27 08:43:12 +08:00
import LayCard from './module/card/index'
2021-09-27 06:09:33 +08:00
import LayLayout from "./module/layout/index"
import LaySide from "./module/side/index"
import LayBody from "./module/body/index"
import LayHeader from "./module/header/index"
import LayFooter from "./module/footer/index"
import LayLogo from "./module/logo/index"
2021-09-27 06:59:01 +08:00
import LayPanel from "./module/panel/index"
2021-09-27 06:09:33 +08:00
const components: Record<string, IDefineComponent> = {
LayRadio,
LayButton,
LayIcon,
LayLayout,
LaySide,
LayHeader,
LayBody,
LayFooter,
2021-09-27 06:59:01 +08:00
LayLogo,
2021-09-27 08:43:12 +08:00
LayPanel,
LayCard
2021-09-27 06:09:33 +08:00
}
const install = (app: App, options?: InstallOptions): void => {
const _options = options;
app.config.globalProperties.$PROOPTIONS = _options
for (const key in components) {
const item = components[key]
app.component(item.name || key, item)
}
}
export {
LayRadio,
LayIcon,
LayButton,
LayLayout,
LaySide,
LayHeader,
LayBody,
LayFooter,
LayLogo,
2021-09-27 06:59:01 +08:00
LayPanel,
2021-09-27 08:43:12 +08:00
LayCard,
2021-09-27 06:09:33 +08:00
install,
}
export default { install }