mirror of
https://github.com/fantastic-admin/basic.git
synced 2026-10-07 13:28:38 +08:00
PageMain 组件增加 title slot 设置
This commit is contained in:
@@ -14,8 +14,9 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
const collaspeData = ref(props.collaspe)
|
||||
const titleSlot = !!useSlots().title
|
||||
|
||||
const collaspeData = ref(props.collaspe)
|
||||
function unCollaspe() {
|
||||
collaspeData.value = false
|
||||
}
|
||||
@@ -30,7 +31,10 @@ function unCollaspe() {
|
||||
'height': collaspeData ? height : ''
|
||||
}"
|
||||
>
|
||||
<div v-if="title" class="title-container">{{ title }}</div>
|
||||
<div v-if="titleSlot || title" class="title-container">
|
||||
<slot v-if="titleSlot" name="title" />
|
||||
<template v-else>{{ title }}</template>
|
||||
</div>
|
||||
<slot />
|
||||
<div v-if="collaspeData" class="collaspe" title="展开" @click="unCollaspe">
|
||||
<el-icon>
|
||||
|
||||
Reference in New Issue
Block a user