vue无法获取$store中的变量

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

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

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

原文地址:https://www.cnblogs.com/ticlab/p/15351389.html