nested-dialog.vue 829 B

123456789101112131415161718192021222324252627
  1. <template>
  2. <el-button text @click="outerVisible = true">open the outer Dialog</el-button>
  3. <el-dialog v-model="outerVisible" title="Outer Dialog">
  4. <template #default>
  5. <el-dialog v-model="innerVisible" width="30%" title="Inner Dialog" append-to-body />
  6. </template>
  7. <template #footer>
  8. <div class="dialog-footer">
  9. <el-button @click="outerVisible = false">Cancel</el-button>
  10. <el-button type="primary" @click="innerVisible = true">open the inner Dialog</el-button>
  11. </div>
  12. </template>
  13. </el-dialog>
  14. </template>
  15. <script lang="ts" setup>
  16. import { ref } from 'vue'
  17. const outerVisible = ref(false)
  18. const innerVisible = ref(false)
  19. </script>
  20. <style scoped>
  21. .dialog-footer button:first-child {
  22. margin-right: 10px;
  23. }
  24. </style>