-
I'm using petite-vue as I need to do very basic UI updates in a webpage and have been drawn to its filesize and simplicity. I'd like to control the UI's state of visible / invisible DOM elements and class names and styles of various elements. I have multiple JavaScript files in my app, I'd like to be able to make these changes from any of them. In Vue JS it was possible to do things like this...
I'm trying the same with Petite Vue but it does nothing.
Logging the app gives just a directive and mount attribute, I can't find the Demo: Is this just impossible? I have an app with hundreds of JavaScript files, and I'd like to modify the UI state from any of them, so ideally I'd like to do something like:
...and then have my UI update on the page. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I overlooked this in the docs, the trick is to import @vue/reactivity — https://github.com/vuejs/petite-vue#global-state-management Updated example |
Beta Was this translation helpful? Give feedback.
I overlooked this in the docs, the trick is to import @vue/reactivity —
https://github.com/vuejs/petite-vue#global-state-management
Updated example
https://codepen.io/EightArmsHQ/pen/ExEYYXQ