mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
38 lines
861 B
Vue
38 lines
861 B
Vue
<template>
|
|
<div>
|
|
<h1>
|
|
Hello {{name}}!
|
|
</h1>
|
|
|
|
<div class="colors">
|
|
<ul v-if="colors.length">
|
|
<li v-for="color in colors" class="color" v-bind:style="'background-color: ' + color">
|
|
{{color}}
|
|
</li>
|
|
</ul>
|
|
<div v-else>
|
|
No colors!
|
|
</div>
|
|
</div>
|
|
<button type="button" v-on:click="clickCount += 1">
|
|
You clicked the button {{clickCount}} time(s)
|
|
</button>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
module.exports = {
|
|
data: function() {
|
|
return {
|
|
clickCount: 0,
|
|
name: 'Frank',
|
|
colors: ['red', 'green', 'blue']
|
|
};
|
|
},
|
|
methods: {
|
|
handleButtonClick: function() {
|
|
this.clickCount++;
|
|
}
|
|
}
|
|
}
|
|
</script> |