<template>
  <kk-button @click="visible = true">
    Open Dialog with customized header
  </kk-button>
  <kk-dialog v-model="visible" :show-close="false">
    <template #header="{ close, titleId, titleClass }">
      <div class="my-header">
        <h4 :id="titleId" :class="titleClass">This is a custom header!</h4>
        <kk-button type="danger" @click="close">
          <el-icon class="el-icon--left"><CircleCloseFilled /></el-icon>
          Close
        </kk-button>
      </div>
    </template>
    This is dialog content.
  </kk-dialog>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import { KkButton, KkDialog } from 'kankan-components'
import { CircleCloseFilled } from '@element-plus/icons-vue'

const visible = ref(false)
</script>

<style scoped>
.my-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}
</style>
