Force redraw of Petite Vue #18
Unanswered
worldoptimizer
asked this question in
Q&A
Replies: 2 comments
-
To get this working I am now doing this…
This virtually replaces the HTML tree with a new copy. The HTML5 runtime doesn't mind as it has a "loose" data binding to elements it animates as it (re)fetches them by ID when needed. It works, but I'd still would like to have something less radical to remove v-on etc. and do a fresh mount. Feedback welcome … |
Beta Was this translation helpful? Give feedback.
0 replies
-
Has anybody found a better solution? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In my case, I got a host application (library with its own scene management, I can't modify). On scene changes, it resets the inner HTML of some div endpoints to the original content (in some cases the "Mustache" syntax or empty if v-text was used as the original content was empty). This has nothing to-do with Petite Vue… it's just the way this particular HTML5 runtime resets scenes on each visit (Tumult Hype).
As the fields have been bound by v-text or use "Mustache" syntax or v-effect, how can I "force" a redraw of Petite Vue after a scene change has "reset" them without Petite Vue being aware of these changes… unmounting and mounting it entirely would be an option (to mimic the runtime resetting everything) but only works partially as it leaves the v-on:click event handler behind (firing multiple times, as many times as the scene was visited and mounted).
My current setup is something like this…
element being the scene container in HypeScenePrepareForDisplay. hypeDocument being the API.
Is there a simpler/cleaner way to force redraw/update?
Is it intended that v-on events stay behind after unmount?
Beta Was this translation helpful? Give feedback.
All reactions