cwg-tips-popup.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <cwg-popup v-model:visible="visible" type="center" :mask-click="false" :show-footers="true">
  3. <view class="popup-content">
  4. <view v-if="content" class="des1" style="font-size: 16px; line-height: 1.6; margin: 30px 0 50px" v-t="content"/>
  5. <view v-else class="des1" style="font-size: 16px; line-height: 1.6; margin: 30px 0 50px" v-t="content"></view>
  6. <rich-text class="popup-text" :nodes="introduce"></rich-text>
  7. </view>
  8. <template #footer>
  9. <button @click="visible = false">{{ t('Btn.Cancel') }}</button>
  10. <button type="primary" @click="tosubmitConfirm">{{ t('Btn.Confirm') }}</button>
  11. </template>
  12. </cwg-popup>
  13. </template>
  14. <script setup>
  15. import { computed } from 'vue';
  16. import { useI18n } from 'vue-i18n';
  17. const props = defineProps({
  18. visible: {
  19. type: Boolean,
  20. default: false
  21. },
  22. // 弹窗内容
  23. content: {
  24. type: String,
  25. default: ''
  26. },
  27. // 弹窗富文本内容
  28. introduce: {
  29. type: String,
  30. default: ''
  31. },
  32. });
  33. const emit = defineEmits(['update:visible', 'confirm']);
  34. const { t } = useI18n();
  35. // Watch for changes in visible prop and emit update event
  36. const visible = computed({
  37. get: () => props.visible,
  38. set: (value) => emit('update:visible', value)
  39. });
  40. const tosubmitConfirm = () => {
  41. visible.value = false;
  42. emit('confirm');
  43. }
  44. </script>
  45. <style lang="scss" scoped>
  46. </style>