12345678910111213141516171819202122232425262728293031323334353637 |
- export default {
- data() {
- return {
- articleId: '',
- articleInfo: {},
- imageList: [],
- }
- },
- computed: {
- html() {
- const html = this.articleInfo.articleContent
- if (html) {
- return html.replace(/href=/gi, '')
- }
- return ''
- },
- },
- mounted() {
- this.initData()
- },
- methods: {
- initData() {
- this.articleId = parseInt(this.$route.query.articleId)
- this.fetchArticleDetail()
- },
- async fetchArticleDetail() {
- try {
- const res = await this.$http.api.getArticleDetail({
- articleId: this.articleId,
- })
- this.articleInfo = res.data
- } catch (error) {
- console.log(error)
- }
- },
- },
- }
|