JSFiddle - React, Tailwind, and code Playground

by miloer

HTML

<script src="https://cdn.bootcss.com/vue/1.0.17/vue.common.js"></script>
<script src="https://cdn.bootcss.com/vue/1.0.17/vue.js"></script>

<div id="app">

   <other></other>
</div>

JavaScript

var userdefined = Vue.extend({
	template:'<div>{{message}}</div><button v-on:click="doSom">ALERT</bitton>',
   data:function(){
    return{
    	message:'Sth'
    }
  },
  methods:{
     doSom:function(){
       alert('u click this!');
     }
  }
});  
 var other =  Vue.extend({
     template:'<div>other<u></u></div>',
     components:{
         "u":userdefined
     }
 });
Vue.component('other',other);
new Vue({
 el:"#app"
})