JSFiddle - React, Tailwind, and code Playground
by ChangJoo Park
HTML
<div id="app">
<div>
<test></test>
</div>
</div>
JavaScript
var myMixin = {
created: function () {
this.hello()
},
methods: {
hello: function () {
console.log('this component name : ', this.$options.name)
console.log('hello from mixin!')
}
}
}
// define a component that uses this mixin
var Component = {
name: 'test',
mixins: [myMixin],
template: '<div>Hello</div>'
}
new Vue({
el: '#app',
components: {
test: Component
}
})