vue-sync | Sync and store vue state with browser URL params | State Container library
kandi X-RAY | vue-sync Summary
kandi X-RAY | vue-sync Summary
Sync and store vue state with browser URL params
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of vue-sync
vue-sync Key Features
vue-sync Examples and Code Snippets
Community Discussions
Trending Discussions on vue-sync
QUESTION
.sync
Usecase
My app is injecting multiple dynamic components into a view which then binds multiple inputs within each component to data in the parent.
Since v-model
only works on a single value, I've found that .sync
(added again after Vue 2.3) is the only way to two-way bind multiple inputs in each child component to my parent's data.
I've followed the exact syntax in the Vue docs and many tutorials, but when I use :value="value
in my child component it inputs undefined
in my data with no errors in console.
If I use v-model
, it works as expected, however produces a no-mutate-props
error in the console for every single keystroke I press.
I expect two-way binding to work without producing any errors of no-mutate-props
in the console.
I think I need some kind of watcher to check a value that references my prop, but that seems a bit messy, and I'd have to implement it for like 30 components... I'd would prefer something cleaner if possible.
Code Sandbox Example of issue In Child ...ANSWER
Answered 2020-Dec-28 at 00:44The reason value
didn't work is only because you are emitting the same unchanged value
which is passed down. Without v-model
, nothing changes value
, so there was nothing new to emit back up.
Change that input to:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install vue-sync
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page