baianat / vuse

🚧 Build web pages with Vuse, the next-gen interactive page builder powered with Vue.js.
https://baianat.github.io/vuse
MIT License
609 stars 145 forks source link

Build initial themes dynamically? #13

Open snowgears opened 6 years ago

snowgears commented 6 years ago

Hello.

This is technically not an issue with the project but I was hoping you could provide some insight. I am trying to make Vuse use the initial set of themes from a json object I get through an axios call.

In app.js, I need to move the current lines:

// install the builder
      Vue.use(Builder, {
        themes: [
          {
            name: 'Page1',
            sections: [hero2, section2, social3, social4, newsletter]
          }, {
            name: 'Page2',
            tiles: [hero1, section1, social1, social3, newsletter]
          }]
      });

into a method where I will have a json string retrieved from a web service call (in the future). But simply moving this portion of code into a created() method within the app.js Vue declaration causes the builder not to render properly.

I have gone through and verified the builder is still installed with the same options as before and there doesn't appear to be anything wrong data wise. Would I need to go through an force the builder to rerender somehow? Any advice you could give would be greatly appreciated. Thanks!

snowgears commented 6 years ago

Answering my own question for anyone interested.

I had to put the line:

vm.$forceUpdate();

after loading the data from a database in create()

logaretm commented 6 years ago

This could require an enhancement from our part, Currently, Vuse also does not handle external mutations to the schema which may be needed for some cases.