<template>
  <kk-button text @click="outerVisible = true">
    open the outer Dialog
  </kk-button>

  <kk-dialog v-model="outerVisible" title="Outer Dialog">
    <template #default>
      <kk-dialog
        v-model="innerVisible"
        width="30%"
        title="Inner Dialog"
        append-to-body
      />
    </template>
    <template #footer>
      <div class="dialog-footer">
        <kk-button @click="outerVisible = false">Cancel</kk-button>
        <kk-button type="primary" @click="innerVisible = true">
          open the inner Dialog
        </kk-button>
      </div>
    </template>
  </kk-dialog>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import { KkButton, KkDialog } from 'kankan-components'
const outerVisible = ref(false)
const innerVisible = ref(false)
</script>
<style scoped>
.dialog-footer button:first-child {
  margin-right: 10px;
}
</style>
