customization-header.vue 707 B

1234567891011121314151617181920212223
  1. <template>
  2. <el-button @click="visible = true">
  3. Open Drawer with customized header
  4. </el-button>
  5. <el-drawer v-model="visible" :show-close="false">
  6. <template #header="{ close, titleId, titleClass }">
  7. <h4 :id="titleId" :class="titleClass">This is a custom header!</h4>
  8. <el-button type="danger" @click="close">
  9. <el-icon class="el-icon--left"><CircleCloseFilled /></el-icon>
  10. Close
  11. </el-button>
  12. </template>
  13. This is drawer content.
  14. </el-drawer>
  15. </template>
  16. <script lang="ts" setup>
  17. import { ref } from 'vue'
  18. import { ElButton, ElDrawer } from 'element-plus'
  19. import { CircleCloseFilled } from '@element-plus/icons-vue'
  20. const visible = ref(false)
  21. </script>