[新增] collapse 组件

This commit is contained in:
就眠仪式
2021-10-01 13:35:00 +08:00
parent e069f5a273
commit f574c2aac0
6 changed files with 81 additions and 25 deletions

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 || 'LayCollapseItem', Component)
}
export default Component as IDefineComponent

View File

@@ -0,0 +1,21 @@
<template>
<div class="layui-colla-item">
<h2 class="layui-colla-title">
{{ title }}<i class="layui-icon layui-colla-icon"></i>
</h2>
<div class="layui-colla-content layui-show">
<p>
<slot></slot>
</p>
</div>
</div>
</template>
<script setup name="LayCollapseItem" lang="ts">
import { defineProps } from 'vue'
const props =
defineProps<{
title?: string
}>()
</script>