element-plus/docs/examples/drawer/customization-header.vue
opengraphica 9c51dab123
feat(components): [dialog] a11y and focus trap on dialog components (#7550)
* feat(components): [dialog] a11y and focus trap on dialog components

* feat(components): [dialog] remove default browser focus style

* feat(components): [dialog] clean up async and comment
2022-05-10 17:58:18 +08:00

24 lines
712 B
Vue

<template>
<el-button @click="visible = true">
Open Drawer with customized header
</el-button>
<el-drawer v-model="visible" :show-close="false">
<template #header="{ close, titleId, titleClass }">
<h4 :id="titleId" :class="titleClass">This is a custom header!</h4>
<el-button type="danger" @click="close">
<el-icon class="el-icon--left"><CircleCloseFilled /></el-icon>
Close
</el-button>
</template>
This is drawer content.
</el-drawer>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
import { CircleCloseFilled } from '@element-plus/icons-vue'
import type { ElButton, ElDrawer } from 'element-plus'
const visible = ref(false)
</script>