Nuxt/test/fixtures/basic/pages/store.vue

28 lines
546 B
Vue
Raw Normal View History

2017-03-25 23:53:50 +00:00
<template>
<div>
<h1>foo/bar/baz: {{ baz }}</h1>
<br>
<h2>index/counter: {{ $store.state.counter }}</h2>
2018-01-31 19:46:57 +00:00
<br>
<h3>foo/blarg/getVal: {{ getVal }}</h3>
2018-01-31 20:22:02 +00:00
<br>
<h4>foo/bab/getBabVal: {{ getBabVal }}</h4>
<br>
<button @click="$store.commit('increment')">
+1
</button>
</div>
2017-03-25 23:53:50 +00:00
</template>
<script>
import { mapGetters } from 'vuex'
export default {
2018-01-31 19:46:57 +00:00
computed: {
...mapGetters('foo/bar', ['baz']),
2018-01-31 20:22:02 +00:00
...mapGetters('foo/blarg', ['getVal']),
...mapGetters('bab', ['getBabVal'])
2018-01-31 19:46:57 +00:00
}
2017-03-25 23:53:50 +00:00
}
</script>