JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://cdn.jsdelivr.net/vue/latest/vue.js"></script>
<div id="demo">
<p>{{message}}</p>
<input v-model="message">
<button @click.prevent="addCustom">
Add custom
</button>
<custom></custom>
<div id="#target">
</div>
</div>
JavaScript
var custom = Vue.extend({
template: "<p>I am custom</p>"
})
var demo = new Vue({
el: '#demo',
data: {
message: 'Hello Vue.js!'
},
components: {
custom: custom
},
methods: {
addCustom: function() {
this.$mount("#target")
}
}
})