vue无法获取$store中的变量

需求是向后端传登陆用户的ID,写成this.$store.user.userID

结果后端没收到,原来是少写了一个state

改为this.$store.state.user.userID后正常。

posted @ 2021-09-29 09:51  dutrmp19  阅读(434)  评论(0)    收藏  举报