Commit b3e9fdc3 authored by yaya's avatar yaya

feat:优化

parent cb68e0b3
...@@ -175,6 +175,7 @@ export default { ...@@ -175,6 +175,7 @@ export default {
const goodsId = this.$route.query.id const goodsId = this.$route.query.id
detailGoods(goodsId).then(response => { detailGoods(goodsId).then(response => {
this.goods = response.data.data.goods this.goods = response.data.data.goods
this.goods.detail = this.trimHtml(this.goods.detail)
this.categoryIds = response.data.data.categoryIds this.categoryIds = response.data.data.categoryIds
this.itemImages = [] this.itemImages = []
...@@ -194,6 +195,10 @@ export default { ...@@ -194,6 +195,10 @@ export default {
this.categoryList = response.data.data.categoryList this.categoryList = response.data.data.categoryList
}) })
}, },
trimHtml(html_str) {
const text = html_str && html_str.replace(/<[^<>]+>/g, '') || ''
return text
},
handleCategoryChange(value) { handleCategoryChange(value) {
this.goods.cid = value[value.length - 1] this.goods.cid = value[value.length - 1]
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment