dialog-confirm.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <dialog-base ref="baseDialog" title="提示">
  3. <view class="msg uni-row">{{message}}</view>
  4. <view class="btn-container uni-row">
  5. <button type="primary" class="btn" @click="handleConfirm">确认</button>
  6. <button type="primary" class="btn" @click="handleCancel">取消</button>
  7. </view>
  8. </dialog-base>
  9. </template>
  10. <script setup>
  11. import {
  12. ref,
  13. getCurrentInstance
  14. } from 'vue'
  15. import {
  16. saveUserequipment
  17. } from '@/api/business/userEquipment/userEquipment.js'
  18. import {
  19. defineProps
  20. } from 'vue'
  21. const baseDialog = ref(null)
  22. const message = ref('')
  23. const reqParam = ref({})
  24. const emit = defineEmits(['submit'])
  25. function open(msg) {
  26. message.value = msg;
  27. baseDialog.value.open();
  28. }
  29. function handleConfirm() {
  30. emit('submit');
  31. close();
  32. }
  33. function handleCancel() {
  34. close();
  35. }
  36. function close() {
  37. baseDialog.value.close()
  38. }
  39. defineExpose({
  40. open
  41. })
  42. </script>
  43. <style lang="scss">
  44. .dialog-body {
  45. .msg {
  46. height: 300rpx;
  47. justify-content: center;
  48. align-items: center;
  49. }
  50. .btn-container {
  51. margin-top: 32rpx;
  52. .btn {
  53. flex: 1;
  54. margin: 0 10rpx;
  55. }
  56. }
  57. }
  58. </style>