tipSmallDialog.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <!-- 小弹窗 一行文字 -->
  2. <template>
  3. <uni-popup ref="tipSmallPopup" :animation="false" :is-mask-click="false"
  4. mask-background-color="rgba(0,0,0, 0.76);">
  5. <view class="ezy-tip-dialog tip-small-dialog">
  6. <view class="tip-content-box">
  7. <view class="tip-title">{{title}}</view>
  8. <view class="tip-content">{{content}}</view>
  9. <view class="tip-btn-box">
  10. <ezyActiveVue class="ezy-btn-active not-confirm-btn" @aclick="handleClose">{{qxBtnName}}</ezyActiveVue>
  11. <ezyActiveVue class="ezy-btn-active confirm-btn" @aclick="confirmBtn">{{qrBtnName}}</ezyActiveVue>
  12. </view>
  13. </view>
  14. </view>
  15. </uni-popup>
  16. </template>
  17. <script setup>
  18. import { ref } from 'vue';
  19. import ezyActiveVue from "@/components/ezyActive/ezyActive.vue";
  20. const props = defineProps({
  21. title: {
  22. type: String,
  23. default: '提示'
  24. },
  25. content: {
  26. type: String,
  27. require: true,
  28. default: ''
  29. },
  30. qxBtnName: {
  31. type: String,
  32. default: '取消'
  33. },
  34. qrBtnName: {
  35. type: String,
  36. default: '确认'
  37. },
  38. });
  39. const tipSmallPopup = ref(null); // 索引
  40. const $emit = defineEmits(['confirm-btn'])
  41. // 打开弹窗
  42. function handleShow() {
  43. tipSmallPopup.value.open();
  44. }
  45. // 取消
  46. function handleClose() {
  47. tipSmallPopup.value.close();
  48. }
  49. // 确认
  50. function confirmBtn(){
  51. $emit('confirm-btn');
  52. tipSmallPopup.value.close();
  53. }
  54. defineExpose({
  55. handleShow,handleClose
  56. })
  57. </script>
  58. <style>
  59. </style>