DialogPreviewSuggest.vue 885 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <template>
  2. <div>
  3. <el-dialog title="查看健康建议" v-model="dialogVisible">
  4. <template #header>
  5. <h4>
  6. {{ props.data.createdAt.split(" ")[0] }} 至
  7. {{ props.data.nextTime.split(" ")[0] }}
  8. </h4>
  9. </template>
  10. <div>
  11. {{ props.data.advise }}
  12. </div>
  13. <template #footer> </template>
  14. </el-dialog>
  15. </div>
  16. </template>
  17. <script lang="ts" setup>
  18. import { ref, computed, defineProps, defineEmits, watch } from "vue";
  19. const props = defineProps({
  20. show: {
  21. type: Boolean,
  22. default: false
  23. },
  24. data: {
  25. type: Object,
  26. default: () => {}
  27. }
  28. });
  29. const emits = defineEmits(["update:show"]);
  30. const dialogVisible = computed({
  31. get() {
  32. return props.show;
  33. },
  34. set(n) {
  35. emits("update:show", n);
  36. }
  37. });
  38. watch(
  39. () => dialogVisible.value,
  40. n => {
  41. if (n) {
  42. } else {
  43. }
  44. }
  45. );
  46. </script>