## wepy2 package.json ``` "@wepy/core": "^2.0.0-alpha.16", "@wepy/x": "^2.0.2" ``` ### 想在mixins中使用 mapState ``` import { mapState, mapActions } from '@wepy/x' export default { computed: { ...mapState([ 'UserInfo' ]) }, methods: { ...mapActions(['storeSaveUserInfo']) }, created() {} } ``` ### wepy页面正常使用需要同时导入 common 和 stroe文件 ``` <script> import commonMixins from '@/mixins/common' import store from '@/store' wepy.page( store, mixins: [commonMixins] )} </script> ``` 若只导入common不引入stroe则报错 ![](https://img.kancloud.cn/fa/d8/fad8b9f1feb80b717b94aa043214bfe8_746x378.png) 点击 `at WepyPage.mappedState (vendor.js?[sm]:4765)` 跳转发现 **this.$store.state** 和 **this.$store.getters**问题 ![](https://img.kancloud.cn/57/19/57198ec7b20aefc971658f6fbdbbae31_347x203.png) ### 若引入 mapGetters 同理报错 ![](https://img.kancloud.cn/b2/cd/b2cd51b352185f6a6a20f52e256fc5ad_747x374.png)