[新增] field 字段组件
This commit is contained in:
@@ -38,6 +38,7 @@ import LayCheckbox from './module/checkbox/index'
|
||||
import LayForm from './module/form/index'
|
||||
import LayBreadcrumb from './module/breadcrumb/index'
|
||||
import LayBreadcrumbItem from './module/breadcrumbItem/index'
|
||||
import LayField from './module/field/index'
|
||||
|
||||
const components: Record<string, IDefineComponent> = {
|
||||
LayRadio,
|
||||
@@ -74,7 +75,8 @@ const components: Record<string, IDefineComponent> = {
|
||||
LayForm,
|
||||
LayBreadcrumb,
|
||||
LayBreadcrumbItem,
|
||||
LayAvatar
|
||||
LayAvatar,
|
||||
LayField
|
||||
}
|
||||
|
||||
const install = (app: App, options?: InstallOptions): void => {
|
||||
@@ -125,6 +127,7 @@ export {
|
||||
LayBreadcrumb,
|
||||
LayBreadcrumbItem,
|
||||
LayAvatar,
|
||||
LayField,
|
||||
install,
|
||||
}
|
||||
|
||||
|
||||
9
src/module/field/index.ts
Normal file
9
src/module/field/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 || 'LayField', Component)
|
||||
}
|
||||
|
||||
export default Component as IDefineComponent
|
||||
15
src/module/field/index.vue
Normal file
15
src/module/field/index.vue
Normal file
@@ -0,0 +1,15 @@
|
||||
<template>
|
||||
<fieldset class="layui-elem-field">
|
||||
<legend>{{title}}</legend>
|
||||
<div class="layui-field-box">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</fieldset>
|
||||
</template>
|
||||
|
||||
<script setup name="LayField" lang="ts">
|
||||
const props =
|
||||
defineProps<{
|
||||
title?: string
|
||||
}>()
|
||||
</script>
|
||||
Reference in New Issue
Block a user