perf(field): 根据 slot 内容决定 块状 线条 状态
This commit is contained in:
@@ -1,14 +1,25 @@
|
||||
<template>
|
||||
<fieldset class="layui-elem-field">
|
||||
|
||||
<fieldset v-if="slot.default" class="layui-elem-field">
|
||||
<legend>{{ title }}</legend>
|
||||
<div class="layui-field-box">
|
||||
<slot />
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset v-else class="layui-elem-field layui-field-title">
|
||||
<legend><a name="docend">结语</a></legend>
|
||||
</fieldset>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup name="LayField" lang="ts">
|
||||
const props = defineProps<{
|
||||
title?: string
|
||||
}>()
|
||||
import { defineProps, useSlots } from 'vue'
|
||||
|
||||
const slot = useSlots()
|
||||
|
||||
const props =
|
||||
defineProps<{
|
||||
title?: string
|
||||
}>()
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user