vue-tree icon indicating copy to clipboard operation
vue-tree copied to clipboard

Expand button not working?

Open nolram88 opened this issue 6 years ago • 4 comments

When I click the expand or checked buttons nothing happens. I checked deeper and I see that

expandNode(node) {
                const expended = !node.expanded
                this.setAttr(node, 'expanded', expended)
                this.setAttr(node, 'hasExpended', true)
                if (node.children || node.async) {
                    if (node.async && !node.children) {
                        this.emitEventToTree('async-load-nodes', node)
                    }
                }

            }

is doing nothing. There are children in the parent nodes. I tried async-load-nodes and the event works and i can add nodes but it still does not expand. The computed values

showExpand

and

 showNextUl

do not update what can I do to force them to update? I did notice that when I make a change and vue-cli does a hot-reload, then the expand feature works.

nolram88 avatar Nov 11 '18 19:11 nolram88

@nolram88 you want a callback event when you click expand?

odanzhou avatar Nov 12 '18 12:11 odanzhou

the callback does trigger but the this.$set statements do not seem to update computed values. the expand button does not change it stays as a + symbol and the children do not show

On Mon, Nov 12, 2018 at 7:10 AM CosSalt [email protected] wrote:

@nolram88 https://github.com/nolram88 you want a callback event when you click expand?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/halower/vue-tree/issues/140#issuecomment-437856733, or mute the thread https://github.com/notifications/unsubscribe-auth/ABBAh3ZniXuM30HN_0H404JnUXP02o56ks5uuWUxgaJpZM4YYpYO .

nolram88 avatar Nov 12 '18 14:11 nolram88

@nolram88 show the code

odanzhou avatar Nov 13 '18 13:11 odanzhou

@nolram88 I had a similar problem when adding the tree component dynamically.

I had to force the update of the tree component when it is computed() using a :key="xy" property.

@see http://michaelnthiessen.com/force-re-render/

hope this helps..

phil-rbn avatar Mar 11 '19 17:03 phil-rbn