destroy-on-close.vue 977 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <template>
  2. <kk-button text @click="centerDialogVisible = true">
  3. Click to open Dialog
  4. </kk-button>
  5. <kk-dialog
  6. v-model="centerDialogVisible"
  7. title="Notice"
  8. width="30%"
  9. destroy-on-close
  10. center
  11. >
  12. <span>
  13. Notice: before dialog gets opened for the first time this node and the one
  14. bellow will not be rendered
  15. </span>
  16. <div>
  17. <strong>Extra content (Not rendered)</strong>
  18. </div>
  19. <template #footer>
  20. <span class="dialog-footer">
  21. <kk-button @click="centerDialogVisible = false">Cancel</kk-button>
  22. <kk-button type="primary" @click="centerDialogVisible = false">
  23. Confirm
  24. </kk-button>
  25. </span>
  26. </template>
  27. </kk-dialog>
  28. </template>
  29. <script lang="ts" setup>
  30. import { ref } from 'vue'
  31. import { KkButton, KkDialog } from 'kankan-components'
  32. const centerDialogVisible = ref(false)
  33. </script>
  34. <style scoped>
  35. .dialog-footer button:first-child {
  36. margin-right: 10px;
  37. }
  38. </style>