Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mpvue下使用不渲染页面 #13

Open
moshanghan opened this issue Jul 3, 2018 · 4 comments
Open

mpvue下使用不渲染页面 #13

moshanghan opened this issue Jul 3, 2018 · 4 comments

Comments

@moshanghan
Copy link

moshanghan commented Jul 3, 2018

<template>
  <div class="articleWap">
    <wxparser :rich-text="articleData" />
  </div>
</template>

<script>
import { getRequest } from '@/utils/wxRequest.js'
var Api = require('@/utils/api.js')
export default {
  data () {
    return {
      articleId: '',
      articleData: {}
    }
  },
  mounted () {
    this.$nextTick(() => {
      this.articleId = this.$root.$mp.query.id
      this.getDetailData()
    })
  },
  methods: {
    getDetailData () {
      var getPostDetailRequest = getRequest(Api.getPostByID(this.articleId))
      getPostDetailRequest.then(({ data, statusCode }) => {
        if (statusCode === 200) {
          this.articleData = data.content.rendered
          console.log(this.articleData)
        }
      })
    }
  }
}
</script>
@shiqikai
Copy link

+1

@tophantWeb
Copy link

数量不大,可以用mpvue wxparse 基于mpvue的 就是数据量大会卡顿

@tophantWeb
Copy link

+1

@tophantWeb
Copy link

"version": "0.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants