[新增] lay-line 分割线组件

This commit is contained in:
就眠仪式
2021-09-27 22:01:22 +08:00
parent 4abe76d8b9
commit eec76e2cb1
6 changed files with 80 additions and 28 deletions

View File

@@ -22,6 +22,7 @@ import LayRow from "./module/row/index"
import LayInput from "./module/input/index"
import LayBadge from "./module/badge/index"
import LayBlock from "./module/block/index"
import LayLine from "./module/line/index"
const components: Record<string, IDefineComponent> = {
LayRadio,
@@ -42,7 +43,8 @@ const components: Record<string, IDefineComponent> = {
LayCol,
LayInput,
LayBadge,
LayBlock
LayBlock,
LayLine
}
const install = (app: App, options?: InstallOptions): void => {
@@ -75,6 +77,7 @@ export {
LayInput,
LayBadge,
LayBlock,
LayLine,
install,
}

9
src/module/line/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 || 'LayLine', Component)
}
export default Component as IDefineComponent

12
src/module/line/index.vue Normal file
View File

@@ -0,0 +1,12 @@
<template>
<hr :class="['layui-border-' + theme]" />
</template>
<script setup name="LayLine" lang="ts">
import { defineProps } from '@vue/runtime-core'
const props =
defineProps<{
theme?: string
}>()
</script>