[其他] 初始化项目结构

This commit is contained in:
就眠仪式
2021-09-27 06:09:33 +08:00
commit b2fa2b90b8
73 changed files with 9752 additions and 0 deletions

9
src/module/body/index.ts Normal file
View 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

View File

@@ -0,0 +1,9 @@
<template>
<div class="layui-body">
<slot></slot>
</div>
</template>
<script setup name="LayBody" lang="ts">
</script>

View 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

View 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>

View 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

View File

@@ -0,0 +1,9 @@
<template>
<div class="layui-footer">
<slot></slot>
</div>
</template>
<script setup name="LayFooter" lang="ts">
</script>

View 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

View 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
View 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

View File

@@ -0,0 +1,7 @@
<template>
<button class="layui-btn">按钮</button>
</template>
<script setup name="LayButton" lang="ts">
</script>

View 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

View 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
View 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

View File

@@ -0,0 +1,9 @@
<template>
<div class="layui-logo">
<slot></slot>
</div>
</template>
<script setup name="LayLogo" lang="ts">
</script>

View 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

View File

@@ -0,0 +1,7 @@
<template>
<div></div>
</template>
<script setup name="LayRadio" lang="ts">
</script>

9
src/module/side/index.ts Normal file
View 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

View 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
View File

@@ -0,0 +1 @@
export * from './public'

17
src/module/type/public.ts Normal file
View 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
}