Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

自定义渲染函数的问题 #94

Open
huangche007 opened this issue Sep 11, 2020 · 0 comments
Open

自定义渲染函数的问题 #94

huangche007 opened this issue Sep 11, 2020 · 0 comments

Comments

@huangche007
Copy link

<wxParse v-if="result.detail" :content="result.detail" :noData="'数据正在加载...'" :startHandler="startHandler" ></wxParse>

我想循环node节点中的nodes属性,过滤一些内容,代码如下:

` startHandler(node,results) {
node.styleStr ? node.styleStr = '':''
this.handleFilter(node)
},
handleFilter(node) {
console.log('item.node:',node,node.nodes)
if(node.nodes && node.nodes.length>0) {

    node.nodes = node.nodes.filter((item) => {
      if(item.node == 'text') {
        
        return item.text!=''
      }
      return item
    })
    this.handleFilter(node)
  }
},`

但是这里打印的node对象的nodes属性为undefined,请问如何解决?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant