dialog.vue 641 B

12345678910111213141516171819202122232425
  1. <template>
  2. <el-button type="text" @click="dialogVisible = true"
  3. >click to open the Dialog</el-button
  4. >
  5. <el-dialog v-model="dialogVisible" title="Tips" width="30%">
  6. <span>This is a message</span>
  7. <template #footer>
  8. <span class="dialog-footer">
  9. <el-button style="margin-right: 10px" @click="dialogVisible = false"
  10. >Cancel</el-button
  11. >
  12. <el-button type="primary" @click="dialogVisible = false"
  13. >Confirm</el-button
  14. >
  15. </span>
  16. </template>
  17. </el-dialog>
  18. </template>
  19. <script lang="ts" setup>
  20. import { ref } from 'vue'
  21. const dialogVisible = ref(true)
  22. </script>