球星卡微信小程序
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.

42 lines
735 B

  1. <template>
  2. <view>
  3. <u-parse :content="article"></u-parse>
  4. </view>
  5. </template>
  6. <script>
  7. import uParse from '@/components/u-parse/u-parse.vue'
  8. export default {
  9. components: {
  10. uParse
  11. },
  12. data(){
  13. return {
  14. id: '',
  15. title: '',
  16. article: ''
  17. }
  18. },
  19. onLoad(options){
  20. // 富文本解析文档:https://ext.dcloud.net.cn/plugin?id=183
  21. this.id = options.id || '';
  22. this.title = options.title || '';
  23. // todo 此处根据文章id获取
  24. this.id && this.getDetail();
  25. },
  26. onReady(){
  27. uni.setNavigationBarTitle({
  28. title: this.title
  29. })
  30. },
  31. methods: {
  32. getDetail(){
  33. console.log("this.id", this.id);
  34. }
  35. }
  36. }
  37. </script>
  38. <style>
  39. @import url("@/components/u-parse/u-parse.css");
  40. </style>