鸿宇研学生前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
985 B

1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
  1. <template>
  2. <view class="page__view">
  3. <!-- 导航栏 -->
  4. <navbar :title="title" leftClick @leftClick="$utils.navigateBack" bgColor="#FFFFFF" />
  5. <!-- <image class="img" :src="details.details" mode="widthFix"></image> -->
  6. <uv-parse :content="content"></uv-parse>
  7. </view>
  8. </template>
  9. <script>
  10. export default {
  11. data() {
  12. return {
  13. title: '',
  14. content: '',
  15. }
  16. },
  17. onLoad({ api, id, idKey, contentKey }) {
  18. this.getData(api, id, idKey, contentKey)
  19. },
  20. methods: {
  21. async getData(api, id, idKey, contentKey) {
  22. try {
  23. const result = await this.$fetch(api, { [idKey]: id })
  24. this.title = result.title
  25. this.content = result[contentKey]
  26. } catch (err) {
  27. console.log('err', err)
  28. }
  29. },
  30. },
  31. }
  32. </script>
  33. <style scoped lang="scss">
  34. .page__view {
  35. background: $uni-bg-color;
  36. }
  37. .img {
  38. width: 100vw;
  39. height: auto;
  40. }
  41. </style>