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

bug fixes

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