123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <template>
- <block>
-
- <rich-text :nodes="content.content"></rich-text>
- </block>
- </template>
- <script>
-
- var app = getApp();
- export default {
- data() {
- return {
- content:""
- };
- },
- onLoad: function(options) {
- this.id = options.id;
- this.getinfo()
- },
- onShow() {
-
- },
- onPullDownRefresh: function() {},
- onReachBottom: function() {
- },
- onShareAppMessage: function() {},
- methods: {
-
- async getinfo() {
- var that = this;
- let res = await this.$api.request('/article/detail', 'GET', {
- id: this.id,
-
- });
-
- res.content = res.content.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"');
-
- this.content = res
- }
- }
- };
- </script>
- <style>
- page {
- background: #F5F5F5;
- padding: 20rpx;
- box-sizing: border-box;
- }
-
- </style>
|