Comments (10)
The simple way to fix it is replace props
with data
in OgBuilder. In this case Vue will be able to properly proxy all the properties and replacing $data
will work. With props
replacement of the $data
property will not work (Vue will not "re-proxy" properties from the new data object, so existing proxied properties will be returning value from the getter closure). Downside is - no data validation (however, it can be worked around with https://github.com/vuejs/vue-validator or with something like https://github.com/hapijs/joi)
Another way is instead of replacing the $data
reference - assign the new values through existing proxied properties. For example, Object.assign(this, selectedData)
. Downside of such approach is - if we will need to assign not existing (not proxied) value - change detection will not work for it.
I guess optimum way to do this will be combination of the props
and data
. Props can be named in format og-url
, og-text-alignment
, etc. and considered as the initial state of the component. In this case $data
can be effectively replaced, change detection will work as expected and flexibility in declarative component configuration through properties will not be lost.
from motif.
I'm looking into this. Oddly, I can't replicate it locally.
from motif.
Just in case - screen recording: https://www.dropbox.com/s/o9j7uk1p0p5u3e5/motif.show-me-a-demo.mov?dl=0
I can reproduce it in Chrome, Chrome Canary, Safari, FF and FF Nightly Build (as well as mobile Chrome and Safari); locally and on motif.imgix.com
from motif.
Do you get anything in your console in the local version? I'm only able to replicate on motif.imgix.com, and no console output there.
from motif.
Nothing.
from motif.
I'm able to replicate locally with a fresh checkout, so there's something very strange going on.
from motif.
Ha! I guess something changed in Vue in between 1.0.16 and 1.0.18. With 1.0.16 it works like a charm!
Update: works with 1.0.17 too, so something changed in 1.0.18
from motif.
After digging through Vue issues a bit, seems like 1.0.18 may have some regressions. I've pinned the Vue dependency at 1.0.17 for now, which works fine. Thanks for the bug report @oaleynik!
from motif.
Related Vuejs issue - vuejs/vue#2520
from motif.
@paulstraw FYI vuejs/vue#2520 (comment)
from motif.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from motif.