JSFiddle - React, Tailwind, and code Playground
by Kiran G
HTML
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<div id="app">
<my-cmp></my-cmp>
<hr>
</div>
JavaScript
var txt = { status: 'Me' };
Vue.component('my-cmp', {
data: function() {
return txt;
},
template: '<p> its {{ status }} <button @click:"youchange"> click to change by You </button> </p> ',
methods: {
youchange: function() {
this.status = 'you';
},
}
});
new Vue({
el:'#app'
})