Guide to Vue.js for jQuery developers
Michał Męciński
2353

It is nice to see some examples of how integrate vue into a traditional server rendered app instead of a SPA.

I’m in the process of replacing jQuery with Vue in one of our legacy apps. 
I’m planning to wrap each page’s content in a div and mounting a vue instance on it to pick up any custom components within.

For example something like this:

<div id="app">
<form action="..">

<label>Vue component</label>
<dropdown-button text="My Button">
... items ...
</dropdown-button>

</form>
</div>
<script>
import Vue from 'vue'
import DropdownButton from '...'

Vue.component( 'dropdown-button', DropdownButton );

new Vue({
el: "#app"
});
</script>

Now I can add any vue components within the form and they will all be processed by the single vue instance.

I wonder if you had considered an approach like this and how do you think it compares to the instance-per-component approach you have detailed above?

Thanks

Like what you read? Give andywarren86 a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.