You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to create a reactive array that would cause the tree view to update every time the data changes but i'm having trouble getting the component to refresh. I've created a computed value called files that maps strings to nodes (giving it a unique id) and when I create a list object using v-for, the list updates properly, but I can't get the tree-view component to update itself with the new data.
Could somebody please tell me what i'm doing wrong? Does initial-model not update after being set once? Please help me out!
Many thanks!
The text was updated successfully, but these errors were encountered:
Hey @moyalmic , I've been trying to set up a StackBlitz for this but apparently the internet is even slower than I thought here and pages keep timing out on me. I never thought I would miss the internet this much... :)
The initial computed value is only applied once in this case because the actual computed value that is initially set changes. If it was a ref instead of a computed and you used a watch to update the ref's value then the tree would see those updates (because that ref object isn't changing, just it's value). I'm hoping that makes sense; this is where the actual example would have been helpful.
It does make sense, I've tried rewriting it using a ref and a watch and again, it seems to be updating correctly when I debug it and log the resulting list to the console, but the tree itself isn't changing reactively :(
Also the first comment under this Stack Overflow post says it's discouraged to use watch in favor of computed properties (especially on arrays which I am doing here)...
Version is v5.2.2
I'm trying to create a reactive array that would cause the tree view to update every time the data changes but i'm having trouble getting the component to refresh. I've created a computed value called
![image](https://private-user-images.githubusercontent.com/98823105/305727304-7fd98b76-263e-4f99-a38d-7f6bb799037a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk4NDc0MjAsIm5iZiI6MTcxOTg0NzEyMCwicGF0aCI6Ii85ODgyMzEwNS8zMDU3MjczMDQtN2ZkOThiNzYtMjYzZS00Zjk5LWEzOGQtN2Y2YmI3OTkwMzdhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzAxVDE1MTg0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY2YzU4OWE5MTFhMTU1NzEzNDNhNzU1MWY4M2VmOTJlZDc0ZWJiZGM1ZWIzODU5N2E1ZjU4ZWNhM2M4NGJmNjAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.MjJxhoyh--bHqJj9TCUUVPnyIDM0BwL0wy4-GNcISCY)
files
that maps strings to nodes (giving it a unique id) and when I create a list object using v-for, the list updates properly, but I can't get the tree-view component to update itself with the new data.Could somebody please tell me what i'm doing wrong? Does
initial-model
not update after being set once? Please help me out!Many thanks!
The text was updated successfully, but these errors were encountered: