diff --git a/src/libs/util.js b/src/libs/util.js index a8b6628..be34c9f 100644 --- a/src/libs/util.js +++ b/src/libs/util.js @@ -147,6 +147,12 @@ const util = { return result }, // 去掉html里的标签及空格 + delTag (html) { + const el = document.createElement('div') + el.innerHTML = html + return el.innerText + }, + // 循环去掉列表里html里的标签及空格 removeTag (list, prop = 'stem') { list.map(e => { const el = document.createElement('div') diff --git a/src/pages/knowledge/index.vue b/src/pages/knowledge/index.vue index 7842fa2..8eab6cf 100644 --- a/src/pages/knowledge/index.vue +++ b/src/pages/knowledge/index.vue @@ -1,6 +1,6 @@