[其他] 初始化项目结构
This commit is contained in:
6593
src/css/layui.css
Normal file
6593
src/css/layui.css
Normal file
File diff suppressed because it is too large
Load Diff
BIN
src/font/iconfont.eot
Normal file
BIN
src/font/iconfont.eot
Normal file
Binary file not shown.
387
src/font/iconfont.svg
Normal file
387
src/font/iconfont.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 309 KiB |
BIN
src/font/iconfont.ttf
Normal file
BIN
src/font/iconfont.ttf
Normal file
Binary file not shown.
BIN
src/font/iconfont.woff
Normal file
BIN
src/font/iconfont.woff
Normal file
Binary file not shown.
BIN
src/font/iconfont.woff2
Normal file
BIN
src/font/iconfont.woff2
Normal file
Binary file not shown.
50
src/index.ts
Normal file
50
src/index.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
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'
|
||||
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"
|
||||
|
||||
const components: Record<string, IDefineComponent> = {
|
||||
LayRadio,
|
||||
LayButton,
|
||||
LayIcon,
|
||||
LayLayout,
|
||||
LaySide,
|
||||
LayHeader,
|
||||
LayBody,
|
||||
LayFooter,
|
||||
LayLogo
|
||||
}
|
||||
|
||||
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,
|
||||
install,
|
||||
}
|
||||
|
||||
export default { install }
|
||||
9
src/module/body/index.ts
Normal file
9
src/module/body/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { App } from 'vue'
|
||||
import Component from './index.vue'
|
||||
import type { IDefineComponent } from '../type/index'
|
||||
|
||||
Component.install = (app: App) => {
|
||||
app.component(Component.name || 'LayBody', Component)
|
||||
}
|
||||
|
||||
export default Component as IDefineComponent
|
||||
9
src/module/body/index.vue
Normal file
9
src/module/body/index.vue
Normal file
@@ -0,0 +1,9 @@
|
||||
<template>
|
||||
<div class="layui-body">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="LayBody" lang="ts">
|
||||
|
||||
</script>
|
||||
9
src/module/button/index.ts
Normal file
9
src/module/button/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { App } from 'vue'
|
||||
import Component from './index.vue'
|
||||
import type { IDefineComponent } from '../../type/index'
|
||||
|
||||
Component.install = (app: App) => {
|
||||
app.component(Component.name || 'LayButton ', Component)
|
||||
}
|
||||
|
||||
export default Component as IDefineComponent
|
||||
14
src/module/button/index.vue
Normal file
14
src/module/button/index.vue
Normal file
@@ -0,0 +1,14 @@
|
||||
<template>
|
||||
<button class="layui-btn" :class="[type ? 'layui-btn-' + type : '']">
|
||||
<slot></slot>
|
||||
</button>
|
||||
</template>
|
||||
|
||||
<script setup name="LayButton" lang="ts">
|
||||
import { defineProps } from "@vue/runtime-core";
|
||||
|
||||
const props = defineProps<{
|
||||
type?: string
|
||||
}>()
|
||||
|
||||
</script>
|
||||
9
src/module/footer/index.ts
Normal file
9
src/module/footer/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { App } from 'vue'
|
||||
import Component from './index.vue'
|
||||
import type { IDefineComponent } from '../type/index'
|
||||
|
||||
Component.install = (app: App) => {
|
||||
app.component(Component.name || 'LayFooter', Component)
|
||||
}
|
||||
|
||||
export default Component as IDefineComponent
|
||||
9
src/module/footer/index.vue
Normal file
9
src/module/footer/index.vue
Normal file
@@ -0,0 +1,9 @@
|
||||
<template>
|
||||
<div class="layui-footer">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="LayFooter" lang="ts">
|
||||
|
||||
</script>
|
||||
9
src/module/header/index.ts
Normal file
9
src/module/header/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { App } from 'vue'
|
||||
import Component from './index.vue'
|
||||
import type { IDefineComponent } from '../type/index'
|
||||
|
||||
Component.install = (app: App) => {
|
||||
app.component(Component.name || 'LayHeader', Component)
|
||||
}
|
||||
|
||||
export default Component as IDefineComponent
|
||||
9
src/module/header/index.vue
Normal file
9
src/module/header/index.vue
Normal file
@@ -0,0 +1,9 @@
|
||||
<template>
|
||||
<div class="layui-header">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="LayHeader" lang="ts">
|
||||
|
||||
</script>
|
||||
9
src/module/icon/index.ts
Normal file
9
src/module/icon/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { App } from 'vue'
|
||||
import Component from './index.vue'
|
||||
import type { IDefineComponent } from '../../type/index'
|
||||
|
||||
Component.install = (app: App) => {
|
||||
app.component(Component.name || 'LayIcon', Component)
|
||||
}
|
||||
|
||||
export default Component as IDefineComponent
|
||||
7
src/module/icon/index.vue
Normal file
7
src/module/icon/index.vue
Normal file
@@ -0,0 +1,7 @@
|
||||
<template>
|
||||
<button class="layui-btn">按钮</button>
|
||||
</template>
|
||||
|
||||
<script setup name="LayButton" lang="ts">
|
||||
|
||||
</script>
|
||||
9
src/module/layout/index.ts
Normal file
9
src/module/layout/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { App } from 'vue'
|
||||
import Component from './index.vue'
|
||||
import type { IDefineComponent } from '../type/index'
|
||||
|
||||
Component.install = (app: App) => {
|
||||
app.component(Component.name || 'LayLayout', Component)
|
||||
}
|
||||
|
||||
export default Component as IDefineComponent
|
||||
9
src/module/layout/index.vue
Normal file
9
src/module/layout/index.vue
Normal file
@@ -0,0 +1,9 @@
|
||||
<template>
|
||||
<div class="layui-layout layui-layout-admin">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="LayLayout" lang="ts">
|
||||
|
||||
</script>
|
||||
9
src/module/logo/index.ts
Normal file
9
src/module/logo/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { App } from 'vue'
|
||||
import Component from './index.vue'
|
||||
import type { IDefineComponent } from '../type/index'
|
||||
|
||||
Component.install = (app: App) => {
|
||||
app.component(Component.name || 'LayLogo', Component)
|
||||
}
|
||||
|
||||
export default Component as IDefineComponent
|
||||
9
src/module/logo/index.vue
Normal file
9
src/module/logo/index.vue
Normal file
@@ -0,0 +1,9 @@
|
||||
<template>
|
||||
<div class="layui-logo">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="LayLogo" lang="ts">
|
||||
|
||||
</script>
|
||||
9
src/module/radio/index.ts
Normal file
9
src/module/radio/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { App } from 'vue'
|
||||
import Component from './index.vue'
|
||||
import type { IDefineComponent } from '../../type/index'
|
||||
|
||||
Component.install = (app: App) => {
|
||||
app.component(Component.name || 'LayRadio ', Component)
|
||||
}
|
||||
|
||||
export default Component as IDefineComponent
|
||||
7
src/module/radio/index.vue
Normal file
7
src/module/radio/index.vue
Normal file
@@ -0,0 +1,7 @@
|
||||
<template>
|
||||
<div></div>
|
||||
</template>
|
||||
|
||||
<script setup name="LayRadio" lang="ts">
|
||||
|
||||
</script>
|
||||
9
src/module/side/index.ts
Normal file
9
src/module/side/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { App } from 'vue'
|
||||
import Component from './index.vue'
|
||||
import type { IDefineComponent } from '../type/index'
|
||||
|
||||
Component.install = (app: App) => {
|
||||
app.component(Component.name || 'LaySide', Component)
|
||||
}
|
||||
|
||||
export default Component as IDefineComponent
|
||||
9
src/module/side/index.vue
Normal file
9
src/module/side/index.vue
Normal file
@@ -0,0 +1,9 @@
|
||||
<template>
|
||||
<div class="layui-side">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="LaySide" lang="ts">
|
||||
|
||||
</script>
|
||||
1
src/module/type/index.ts
Normal file
1
src/module/type/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './public'
|
||||
17
src/module/type/public.ts
Normal file
17
src/module/type/public.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import type { App, DefineComponent } from 'vue'
|
||||
export type StringObject = Record<string, unknown>
|
||||
|
||||
export type UnknownObject = Record<string | number, unknown>
|
||||
|
||||
export type UnknownFunction = (...arg: unknown[]) => unknown
|
||||
|
||||
export type IDefineComponent<Props = UnknownObject> = DefineComponent<Props> & {
|
||||
install: (app: App, options?: InstallOptions) => void
|
||||
}
|
||||
|
||||
export interface InstallOptions extends StringObject {
|
||||
/** Pagination Attributes */
|
||||
pagination?: null
|
||||
/** Menu Attributes */
|
||||
menu?: null
|
||||
}
|
||||
Reference in New Issue
Block a user