phphe/he-tree-vue

How can i update a specific tree node?

manyasone opened this issue · 4 comments

Hi,
first of all, thanks for this nice component!

I'm wondering if I can update tree node data directly without having to reload the entire tree.
For example change the title of a node in a given path, after receiving data from an http request.

Is this possible with any of the available api methods? I've been trying for a while now, but without any success.

phphe commented

change node data directly

Hey I have the same question, however my problem is when trying to obtain the node using getNodeByPath method, it says this method is undefined, so how exactly do I call it?
I am using this.treeData.getNodeByPath(Path);

phphe commented

Hey I have the same question, however my problem is when trying to obtain the node using getNodeByPath method, it says this method is undefined, so how exactly do I call it? I am using this.treeData.getNodeByPath(Path);

<template>
<Tree ref="tree"/>
</template>

<script>
export default {
  methods: {
    yourMethod() {
      this.$refs.tree.getNodeByPath(your path)
    }
  }
}
</script>

Hey I have the same question, however my problem is when trying to obtain the node using getNodeByPath method, it says this method is undefined, so how exactly do I call it? I am using this.treeData.getNodeByPath(Path);

<template>
<Tree ref="tree"/>
</template>

<script>
export default {
  methods: {
    yourMethod() {
      this.$refs.tree.getNodeByPath(your path)
    }
  }
}
</script>

Thanks Ill Try It