This commit is contained in:
airjp73 2018-01-31 14:46:57 -05:00
parent c64ee90311
commit 73c1d2aa63
4 changed files with 15 additions and 1 deletions

View File

@ -80,6 +80,7 @@ test.serial('/store', async t => {
t.is(await page.$text('h1'), 'Vuex Nested Modules') t.is(await page.$text('h1'), 'Vuex Nested Modules')
t.is(await page.$text('p'), '1') t.is(await page.$text('p'), '1')
t.is(await page.$text('h2'), '4')
}) })
test.serial('/head', async t => { test.serial('/head', async t => {

View File

@ -3,6 +3,8 @@
<h1>{{ baz }}</h1> <h1>{{ baz }}</h1>
<br> <br>
<p>{{ $store.state.counter }}</p> <p>{{ $store.state.counter }}</p>
<br>
<h2>{{ getVal }}</h2>
</div> </div>
</template> </template>
@ -10,6 +12,9 @@
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
export default { export default {
computed: mapGetters('foo/bar', ['baz']) computed: {
...mapGetters('foo/bar', ['baz']),
...mapGetters('foo/blarg', ['getVal'])
}
} }
</script> </script>

View File

@ -0,0 +1,5 @@
export default {
getVal(state) {
return state.val
}
}

View File

@ -0,0 +1,3 @@
export default () => ({
val: 4
})