Nuxt/examples/with-tape/pages/index.vue
pooya parsa e7cc2757c3 refactor: update eslint-config to 1.x
Co-authored-by: Alexander Lichter <manniL@gmx.net>
2019-07-10 15:15:49 +04:30

36 lines
481 B
Vue
Executable File

<template>
<div>
<h1 :class="className">
Hello {{ name }}!
</h1>
<button @click="changeColor()">
Change h1 Color
</button>
</div>
</template>
<script>
export default {
data () {
return { name: 'world', className: 'red' }
},
methods: {
changeColor () {
this.className = this.className === 'red' ? 'blue' : 'green'
}
}
}
</script>
<style>
.red {
color: red;
}
.blue {
color: blue;
}
.green {
color: green;
}
</style>