Rest
...stores: [...Stores[]]list of stores to map to an object
export default {
computed: {
// other computed properties
...mapStores(useUserStore, useCartStore)
},
created() {
this.userStore // store with id "user"
this.cartStore // store with id "cart"
}
}
Generated using TypeDoc
Allows using stores without the composition API (
setup()
) by generating an object to be spread in thecomputed
field of a component. It accepts a list of store definitions.