refactor permission
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
<template>
|
||||
<div class="card-title">
|
||||
<h3 v-if="title || $slots.title" class="title">
|
||||
<slot name="title">
|
||||
<span v-text="title" />
|
||||
</slot>
|
||||
</h3>
|
||||
<p v-if="description || $slots.description" class="description gray">
|
||||
<slot name="description">
|
||||
<span v-text="description" />
|
||||
</slot>
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
interface Props {
|
||||
title?: string;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
defineProps<Props>();
|
||||
|
||||
defineSlots<{
|
||||
title?: () => unknown;
|
||||
description?: () => unknown;
|
||||
}>();
|
||||
|
||||
defineOptions({
|
||||
name: "CardTitle"
|
||||
});
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.card-title {
|
||||
margin: 1rem;
|
||||
|
||||
.title {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.description {
|
||||
margin: .5rem 0 0 0;
|
||||
font-size: .875rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user