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

Unable to set selectedItems

Open btpham77 opened this issue 6 years ago • 9 comments

Can you make selectedItems as a parameter so prior to load the control, the caller can set selectedItems if need be? So it can be set in mounted () { this.selectedItems = some exported property }

I try to use 'value' property but that only work when the control loads the first time. If the select box has something in it, it wouldn't reset.

btpham77 avatar Apr 27 '18 20:04 btpham77

Why not use v-model

zdy1988 avatar Apr 28 '18 18:04 zdy1988

I did but ... I have a compute property where I bind to v-model. When this property changes, the values do not reflect on the control. As though the initial value is the only thing it keeps. Secondly, if I add some values to the selection then close the dialog with out saving it then go back to the dialog that has the control, the previous selections are still there and not the value I set to bind to v-model.

btpham77 avatar Apr 28 '18 19:04 btpham77

thanks , i think i didn't observe the value update, please wait..

zdy1988 avatar Apr 28 '18 19:04 zdy1988

i published 1.0.7 to fix observe the value

zdy1988 avatar Apr 28 '18 20:04 zdy1988

Thanks for the fix! If I don't want icon for the tree, is there a property on the control to set it?

btpham77 avatar Apr 29 '18 17:04 btpham77

classname :

.icon-hide { display:none;}

data :

{
...
icon: 'icon-hide'
...
}

zdy1988 avatar Apr 30 '18 05:04 zdy1988

True but there is that empty space in between

btpham77 avatar Apr 30 '18 12:04 btpham77

visibility:hidden;

zdy1988 avatar Apr 30 '18 17:04 zdy1988

Even then the empty space still exists. Another issue, after selecting some nodes then save the items. Go back to the control, you won't be able to expand the tree...

btpham77 avatar Apr 30 '18 18:04 btpham77