GithubHelp home page GithubHelp logo

"Show Me a Demo" doesn't work about motif HOT 10 CLOSED

oaleynik avatar oaleynik commented on August 15, 2024
"Show Me a Demo" doesn't work

from motif.

Comments (10)

oaleynik avatar oaleynik commented on August 15, 2024

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.

paulstraw avatar paulstraw commented on August 15, 2024

I'm looking into this. Oddly, I can't replicate it locally.

from motif.

oaleynik avatar oaleynik commented on August 15, 2024

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.

paulstraw avatar paulstraw commented on August 15, 2024

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.

oaleynik avatar oaleynik commented on August 15, 2024

Nothing.

from motif.

paulstraw avatar paulstraw commented on August 15, 2024

I'm able to replicate locally with a fresh checkout, so there's something very strange going on.

from motif.

oaleynik avatar oaleynik commented on August 15, 2024

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.

paulstraw avatar paulstraw commented on August 15, 2024

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.

oaleynik avatar oaleynik commented on August 15, 2024

Related Vuejs issue - vuejs/vue#2520

from motif.

oaleynik avatar oaleynik commented on August 15, 2024

@paulstraw FYI vuejs/vue#2520 (comment)

from motif.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.