contentDialog.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <uni-popup ref="commonPopup" :type="type" :animation="false" :is-mask-click="false" mask-background-color="rgba(0, 0, 0, 0.4)" background-color="#fff">
  3. <slot></slot>
  4. </uni-popup>
  5. </template>
  6. <script setup>
  7. import {
  8. reactive,
  9. ref
  10. } from 'vue';
  11. import {
  12. getJiazhengZhiye
  13. } from "@/api/jiazheng.js"
  14. const props = defineProps({
  15. type: {
  16. type: String,
  17. default: 'bottom'
  18. },
  19. title: {
  20. type: String,
  21. default: ''
  22. },
  23. content: {
  24. type: String,
  25. require: true,
  26. default: ''
  27. },
  28. dialogContentClass: {
  29. type: String,
  30. require: true,
  31. default: 'content-center-class'
  32. },
  33. okBtn: {
  34. type: String,
  35. require: true,
  36. default: '保存'
  37. },
  38. showBtn: {
  39. type: Boolean,
  40. default: true
  41. }
  42. });
  43. const commonPopup = ref(null); // 索引
  44. const $emit = defineEmits(['confirm-btn'])
  45. // 打开弹窗
  46. function handleShow() {
  47. commonPopup.value.open();
  48. }
  49. // 取消
  50. function handleClose() {
  51. commonPopup.value.close();
  52. }
  53. // 确认
  54. function confirmBtn() {
  55. $emit('confirm-btn');
  56. commonPopup.value.close();
  57. }
  58. defineExpose({
  59. handleShow,
  60. handleClose
  61. })
  62. </script>
  63. <style>
  64. </style>