Skip to content

Commit

Permalink
将nodeList转为数组,解决一些App内部nodeList没有forEach方法的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
BUPT-HJM committed Apr 21, 2017
1 parent 6f1eea9 commit b980094
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/src/modules/front/components/Article.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default {
//this.getCurrentArticle(0);
this.$nextTick(() => {
// 提取文章标签,生成目录
this.$refs.post.querySelectorAll("h1,h2,h3,h4,h5,h6").forEach((item, index) => {
Array.from(this.$refs.post.querySelectorAll("h1,h2,h3,h4,h5,h6")).forEach((item, index) => {
item.id = item.localName + '-' + index;
this.category.push({
tagName: item.localName,
Expand Down

0 comments on commit b980094

Please sign in to comment.