QingWei-Li / vuep

🎡 A component for rendering Vue components with live editor and preview.
https://cinwell.com/vuep/
MIT License
887 stars 103 forks source link

possible to inject data from embedding app? #33

Open jaunt opened 6 years ago

jaunt commented 6 years ago

Hello,

I can successfully render components in my app that's embedding vuep, but is there a way to pass app date into vuep somehow? For example, when writing code in the embedded editor, I'd like to be able to refer to live data being generated by the surround app. It seems though, that vuep is essentially a sandbox where no data can come in or out. Is this right? Are there any alternatives to get the behaviour I'm looking for?

Thanks!

AlbertBrand commented 6 years ago

If you pass an object via the scope prop (see https://cinwell.com/vuep/#/?id=javascript-scope), every property of that object is accessible as a variable in code. Getting data out is AFAIK not possible.