index1.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <view class="view-text">
  3. <!-- <u-parse class="uni-body view-content" :content="content"></u-parse> -->
  4. <h3 style="text-align: center; line-height: 45px">{{ contentTitle }}</h3>
  5. <view>{{ content }}</view>
  6. </view>
  7. </template>
  8. <script setup>
  9. import { onReady, onLoad, onShow, onNavigationBarButtonTap } from "@dcloudio/uni-app";
  10. import { ref, onMounted, inject, shallowRef, reactive, getCurrentInstance, toRefs } from "vue";
  11. import { useStores, commonStores } from "@/store/modules/index";
  12. const useStore = useStores();
  13. const { proxy } = getCurrentInstance();
  14. const data = reactive({
  15. title: "",
  16. content: "",
  17. contentTitle: "",
  18. });
  19. const { title, content, contentTitle } = toRefs(data);
  20. onLoad((options) => {
  21. title.value = options.title;
  22. content.value = options.content;
  23. contentTitle.value = options.contentTitle;
  24. uni.setNavigationBarTitle({
  25. title: options.title,
  26. });
  27. });
  28. onShow(() => {
  29. //调用系统主题颜色
  30. proxy.$settingStore.systemThemeColor([1]);
  31. });
  32. </script>
  33. <style lang="scss" scoped>
  34. .view-text {
  35. padding: 5px;
  36. .view-content {
  37. font-size: 26rpx;
  38. color: #333;
  39. line-height: 24px;
  40. word-wrap: break-word;
  41. }
  42. }
  43. </style>