demo1.vue 674 B

1234567891011121314151617181920212223242526
  1. <template>
  2. <m-button @click="dialogVisible = true">点击打开 Dialog</m-button>
  3. <m-dialog
  4. v-model="dialogVisible"
  5. title="提示"
  6. width="30%"
  7. :close-on-click-modal="false"
  8. @open="open"
  9. >
  10. <span>这是一段信息</span>
  11. <template #footer>
  12. <span class="dialog-footer">
  13. <m-button @click="dialogVisible = false" style="margin-right: 20px">取消</m-button>
  14. <m-button type="primary" @click="dialogVisible = false">确定</m-button>
  15. </span>
  16. </template>
  17. </m-dialog>
  18. </template>
  19. <script setup>
  20. import { ref } from 'vue-demi'
  21. const dialogVisible = ref(false)
  22. const open = () => {
  23. console.log('111');
  24. }
  25. </script>