NewsModal.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <ion-page>
  3. <ion-header>
  4. <ion-toolbar>
  5. <ion-buttons slot="end">
  6. <ion-button @click="dismiss()">{{ $t('common.close') }}</ion-button>
  7. </ion-buttons>
  8. </ion-toolbar>
  9. </ion-header>
  10. <ion-content>
  11. <div class="title">{{ detail.title }}</div>
  12. <div class="time">{{ detail.createdAt }}</div>
  13. <div class="content-wrapper">
  14. <div class="content" v-html="detail.detail"></div>
  15. </div>
  16. </ion-content>
  17. </ion-page>
  18. </template>
  19. <script setup>
  20. import { modalController } from '@ionic/vue'
  21. const props = defineProps({
  22. detail: {
  23. type: Object
  24. }
  25. })
  26. const dismiss = async () => {
  27. return await modalController.dismiss()
  28. }
  29. </script>
  30. <style lang="less" scoped>
  31. .title {
  32. text-align: center;
  33. padding: 10px 16px;
  34. line-height: 24px;
  35. font-size: 16px;
  36. font-weight: bold;
  37. }
  38. .time {
  39. line-height: 24px;
  40. font-size: 12px;
  41. color: var(--ion-color-step-400);
  42. text-align: center;
  43. }
  44. .content-wrapper {
  45. padding: 16px;
  46. line-height: 1.5;
  47. color: var(--ion-color-step-800);
  48. :deep(img) {
  49. width: 100%;
  50. height: auto;
  51. }
  52. }
  53. </style>