Help me please! How to work with inputs in Vue3, with reactivity?
v-model - not work, event.target.value - undefined
I’m try to refactor my CEP panel with new technology, but I encounter UXP flaws again and again. How do you guys work with this? Or am I missing something?
I can’t speak for the new defineModel method in Vue 3.4 as I’ve not experimented with that yet.
If using Vue then I’d recommend using Bolt UXP as a foundation. I’ve found that when watching for changes, over time UDT takes progressively longer to reload Vue and it’s a real development bottleneck. Bolt solves this with some kind of websocket magic that I’m not going to pretend to understand
Let me get back to the question. Wrapping sp-textarea or just input does not give any result, because event.target does not have the .value property. Look in the devtools yourself. Maybe it’s just for me?
In the console I see how I can get to the value through a strange object event.target._properties is a Map object that can be expanded (…$event.target._properties.values()) but it looks ugly.
Thank you for reply. Copied your template. No reactivity. Console outputs undefined.
And what version of Vue do you have? Is it with webpack? Maybe something with the settings. And/Or manifest.json. I use the official example for Vue 3 from Adobe’s GitHub.
PS 26.2.0 (macos)
Unfortunately I can’t, because my project has grown quite large and I don’t have the time to isolate the required files. But I also am using the great Bolt UXP boilerplate (as already suggested by @Timothy_Bennett ) as a starting point (I prefer vite over webpack). Did You give it a try? It’ll make Your life much easier in terms of Your project setup.
You can still throw out stuff that You don’t need.
Let me know, if this works.
Yes, everything works great on Bolt UXP! I had avoided this boilerplate because it seemed overloaded with TypeScript to me. Thank you for the help.
It’s a shame that the official example from Adobe doesn’t work properly. Oh well.
Glad You got it working!
Yes, it’s a bit much at first sight.
I neither use Typescript – couldn’t wrap my head around it yet, though I know, it would make my app less error prone and has some other advantages…
The examples from Adobe on github are still very useful references, but yeah, You have to adapt them to Your needs.