1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <template>
- <view>
- <view id="box">
- <uv-parse :content="content" v-if="isShow"></uv-parse>
- </view>
- </view>
- </template>
- <script>
- export default {
- data () {
- return {
- content: "",
- isShow: false,
- imageProp:{
- mode: 'aspectFit',
- padding: 0,
- lazyLoad: false,
- domain: ''
- }
- }
- },
- onLoad (options) {
- this.id = options.id || 0;
- this.get_article();
- },
- methods: {
- get_article () {
- this
- .request
- .post("getContent", {
- id: this.id
- })
- .then(res => {
- if (res.code == 200) {
- this.content = res.data.content;
- uni.setNavigationBarTitle({
- title: res.data.title
- });
- this.isShow = true;
- }
- })
- .catch(err => {
- this.utils.Tip("网络错误,请稍后尝试");
- });
- }
- }
- }
- </script>
- <style lang="scss">
- #box {
- z-index: -1;
- padding: 15px;
- }
- </style>
|