exitDialog.vue 973 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <template>
  2. <uni-popup ref="exitPopup" :animation="false" :is-mask-click="false"
  3. mask-background-color="rgba(255, 255, 255, 0.6);">
  4. <view class="exit-dialog">
  5. <view class="exit-content-box">
  6. <view class="exit-title">提示</view>
  7. <view class="exit-two-title">你确定要执行这个操作吗?</view>
  8. <view class="exit-btn-box">
  9. <view class="not-confirm-btn" @click="handleClose"></view>
  10. <view class="confirm-btn" @click="confirmBtn"></view>
  11. </view>
  12. </view>
  13. </view>
  14. </uni-popup>
  15. </template>
  16. <script setup>
  17. import { ref } from 'vue';
  18. const exitPopup = ref(null); // 索引
  19. const $emit = defineEmits(['confirm-btn'])
  20. // 打开弹窗
  21. function handleShow() {
  22. exitPopup.value.open();
  23. }
  24. // 取消
  25. function handleClose() {
  26. exitPopup.value.close();
  27. }
  28. // 确认
  29. function confirmBtn(){
  30. $emit('confirm-btn');
  31. exitPopup.value.close();
  32. }
  33. defineExpose({
  34. handleShow
  35. })
  36. </script>
  37. <style>
  38. </style>