我是 Vue JS 新手。 刚刚实现了一个示例 TreeView 。
如何刷新整个 TreeView 并用新内容重新加载它?
查看了 Vue API,但没有找到任何内容。
请帮忙。
最佳答案
如果您引用此:http://vuejs.org/examples/tree-view.html
对此没有必要的特殊方法。您只需用新数据替换数据即可:
var demo = new Vue({
el: '#demo',
data: {
treeData: data
},
methods: {
//call this method e.g. from a buttons click event.
flushtree: function() {
this.treeData = newData // get new Data from somehwere.
}
}
})
关于javascript - VueJS : Flush/reload the whole tree-view,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36516453/