JSFiddle - React, Tailwind, and code Playground
by Alex Babakhanov
HTML
<script src='https://unpkg.com/[email protected]/dist/vue.js'></script>
<div id='app'>
<h1>Users</h1>
<my-component name="Just raw string"></my-component>
<my-component v-for='userName in users' :name="userName"></my-component>
</div>
JavaScript
var myComponent = {
template: '<h2>{{greatings}}</h2>',
props: ['name'],
data: function () {
return {
greatings: 'Hello, ' + this.name
};
}
};
new Vue({
el: '#app',
components: {
'my-component': myComponent
},
data: {
users: [
'Elvis Presley',
'Mickey Mouse',
'Lady Gaga'
]
}
});