2016-12-26 14:55:00 +00:00
|
|
|
<template>
|
|
|
|
<div>
|
2018-08-31 20:34:12 +00:00
|
|
|
<p /><h3>Index Module</h3>
|
2018-11-24 18:49:19 +00:00
|
|
|
<button @click="increment">
|
|
|
|
{{ counter }}
|
|
|
|
</button>
|
2018-07-12 12:03:50 +00:00
|
|
|
<br>
|
2018-11-24 18:49:19 +00:00
|
|
|
<NuxtLink to="/about">
|
|
|
|
About
|
|
|
|
</NuxtLink>
|
2018-07-12 12:03:50 +00:00
|
|
|
<br>
|
|
|
|
<br>
|
|
|
|
<h3>Todo Module</h3>
|
2018-11-24 18:49:19 +00:00
|
|
|
<NuxtLink to="/todos">
|
|
|
|
Todos
|
|
|
|
</NuxtLink>
|
2018-07-12 12:03:50 +00:00
|
|
|
<br>
|
|
|
|
<br>
|
|
|
|
<h3>Nested Modules</h3>
|
2018-11-24 18:49:19 +00:00
|
|
|
<NuxtLink to="/website">
|
|
|
|
Website
|
|
|
|
</NuxtLink>
|
2016-12-26 14:55:00 +00:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { mapState } from 'vuex'
|
|
|
|
|
|
|
|
export default {
|
2019-02-18 10:44:03 +00:00
|
|
|
computed: mapState([
|
|
|
|
'counter'
|
|
|
|
]),
|
2016-12-26 14:55:00 +00:00
|
|
|
// fetch(context) is called by the server-side
|
2017-01-09 14:10:01 +00:00
|
|
|
// and before instantiating the component
|
2017-10-31 13:43:55 +00:00
|
|
|
fetch({ store }) {
|
2016-12-26 14:55:00 +00:00
|
|
|
store.commit('increment')
|
|
|
|
},
|
|
|
|
methods: {
|
2017-10-31 13:43:55 +00:00
|
|
|
increment() {
|
2017-08-13 20:19:19 +00:00
|
|
|
this.$store.commit('increment')
|
|
|
|
}
|
2016-12-26 14:55:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|