index.vue 902 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <view>
  3. <view id="box">
  4. <uv-parse :content="content" v-if="isShow"></uv-parse>
  5. </view>
  6. </view>
  7. </template>
  8. <script>
  9. export default {
  10. data () {
  11. return {
  12. content: "",
  13. isShow: false,
  14. imageProp:{
  15. mode: 'aspectFit',
  16. padding: 0,
  17. lazyLoad: false,
  18. domain: ''
  19. }
  20. }
  21. },
  22. onLoad (options) {
  23. this.id = options.id || 0;
  24. this.get_article();
  25. },
  26. methods: {
  27. get_article () {
  28. this
  29. .request
  30. .post("getContent", {
  31. id: this.id
  32. })
  33. .then(res => {
  34. if (res.code == 200) {
  35. this.content = res.data.content;
  36. uni.setNavigationBarTitle({
  37. title: res.data.title
  38. });
  39. this.isShow = true;
  40. }
  41. })
  42. .catch(err => {
  43. this.utils.Tip("网络错误,请稍后尝试");
  44. });
  45. }
  46. }
  47. }
  48. </script>
  49. <style lang="scss">
  50. #box {
  51. z-index: -1;
  52. padding: 15px;
  53. }
  54. </style>