-
Notifications
You must be signed in to change notification settings - Fork 33
initialSelected is not working #12
Comments
Can you see my demo page here It's working, you can see on multiple selection |
how it works, how can i make it happen? I have tried but did not work, but its working after i click. |
Here the code in demo page https://github.com/mazipan/vue-select-image/blob/master/demo/app.js#L68 |
here the code how i set initial selection https://github.com/mazipan/vue-select-image/blob/master/src/VueSelectImage.vue#L149 |
wow, let me check |
I have tried initialSelected with your example, its working on load not but not with other event. I am getting image data from server and pushing it to initialSelected but this not working, I am using vue-dropzone. here is my code sample,
But it worked if i add this using ref
|
Yes, because initialselsection is on Thanks for reporting this case |
even initialSelected is not working in |
check that your ID matches If all of those are equal in dataImages & selectedImages it will reactively select images even on a async api request edit: for me it was an issue with an S3 signature which differed, it would be clever to only rely on the ID rather than ID, alt & src beeing the same for S3 |
I would actually extend this issue to allow for setting the initial value only by the true "value", which in this component is "id". It's not often that you'd be storing whole objects in your DB, so having to rehydrate an entire object just to get pre-selection working is problematic. Ideally an array of objects just with "id" props would be enough. |
Hi, How I can use the let component = this.$refs.userImageSelect |
You should define a ref value to the component. In your case, it look like this: If you do that, then you can reference the component. |
I am getting weirded activity, initial selected is not working on load or before click. After click its working good
The text was updated successfully, but these errors were encountered: