提交 fc7c12e6 authored 作者: 王鹏飞's avatar 王鹏飞

bug fixes

上级 eaf460af
...@@ -42,13 +42,15 @@ export default { ...@@ -42,13 +42,15 @@ export default {
return this.$route.params.id return this.$route.params.id
}, },
html() { html() {
if (this.detail.contents) { const contents = this.detail.contents || ''
return this.detail.contents const hasHtmlTag = contents.includes('<p>')
.replace(/---------- start ----------[\n]{0,1}/gi, '') if (hasHtmlTag) {
.replace(/---------- end ----------/gi, '') return contents
.replace(/\n/g, '<br/>')
} }
return '' return contents
.replace(/---------- start ----------[\n]{0,1}/gi, '')
.replace(/---------- end ----------/gi, '')
.replace(/\n/g, '<br/>')
}, },
isWeapp() { isWeapp() {
return this.$store.state.isWeapp return this.$store.state.isWeapp
......
...@@ -46,13 +46,15 @@ export default { ...@@ -46,13 +46,15 @@ export default {
} }
}, },
html() { html() {
if (this.data.contents) { const contents = this.data.contents || ''
return this.data.contents const hasHtmlTag = contents.includes('<p>')
.replace(/---------- start ----------[\n]{0,1}/gi, '') if (hasHtmlTag) {
.replace(/---------- end ----------/gi, '') return contents
.replace(/\n/g, '<br/>')
} }
return '' return contents
.replace(/---------- start ----------[\n]{0,1}/gi, '')
.replace(/---------- end ----------/gi, '')
.replace(/\n/g, '<br/>')
}, },
isWeapp() { isWeapp() {
return this.$store.state.isWeapp return this.$store.state.isWeapp
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论