2017-10-19 08:56:00 +00:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<input v-model="msg">
|
2018-07-12 12:03:50 +00:00
|
|
|
<p>msg: {{ msg }}</p>
|
|
|
|
<p>env: {{ env }}</p>
|
|
|
|
<p>computed msg: {{ computedMsg }}</p>
|
2018-11-24 18:49:19 +00:00
|
|
|
<button @click="greet">
|
|
|
|
Greet
|
|
|
|
</button>
|
|
|
|
<p>
|
|
|
|
<NuxtLink to="/about">
|
|
|
|
About page
|
|
|
|
</NuxtLink>
|
|
|
|
</p>
|
2017-10-19 08:56:00 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import Vue from 'vue'
|
|
|
|
import Component from 'nuxt-class-component'
|
|
|
|
|
2018-08-10 13:45:58 +00:00
|
|
|
export default
|
2017-10-19 08:56:00 +00:00
|
|
|
@Component({
|
|
|
|
props: {
|
|
|
|
env: String
|
|
|
|
}
|
|
|
|
})
|
2018-08-10 13:45:58 +00:00
|
|
|
class Base extends Vue {
|
2017-10-19 08:56:00 +00:00
|
|
|
// initial data
|
|
|
|
msg = 123
|
|
|
|
|
|
|
|
// lifecycle hook
|
2017-10-31 13:43:55 +00:00
|
|
|
mounted() {
|
2017-10-19 08:56:00 +00:00
|
|
|
this.greet()
|
|
|
|
}
|
|
|
|
|
|
|
|
// computed
|
2017-10-31 13:43:55 +00:00
|
|
|
get computedMsg() {
|
2017-10-19 08:56:00 +00:00
|
|
|
return 'computed ' + this.msg
|
|
|
|
}
|
|
|
|
|
|
|
|
// method
|
2017-10-31 13:43:55 +00:00
|
|
|
greet() {
|
|
|
|
console.log('base greeting: ' + this.msg) // eslint-disable-line no-console
|
2017-10-19 08:56:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|