commonDialog.vue 600 B

12345678910111213141516171819202122232425262728293031323334
  1. <!-- 中弹窗 二行文字 -->
  2. <template>
  3. <uni-popup ref="dialogRef" :animation="false" :is-mask-click="false"
  4. mask-background-color="rgba(255, 255, 255, 0.6);">
  5. <slot></slot>
  6. </uni-popup>
  7. </template>
  8. <script setup>
  9. import { ref } from 'vue';
  10. const props = defineProps({
  11. title: {
  12. type: String,
  13. default: '提示'
  14. },
  15. });
  16. const dialogRef = ref(null); // 索引
  17. // 打开弹窗
  18. function handleShow() {
  19. dialogRef.value.open();
  20. }
  21. // 取消
  22. function handleClose() {
  23. dialogRef.value.close();
  24. }
  25. defineExpose({
  26. handleShow,
  27. handleClose
  28. })
  29. </script>
  30. <style>
  31. </style>