js写!this.$store.getters.data().TpmDeviceline是什么意思
时间: 2024-03-28 08:38:51 浏览: 27
这段代码是使用Vue.js框架中的Vuex状态管理库的语法。`this.$store.getters`表示获取Vuex store中的getter,`data()`是一个getter函数,`TpmDeviceline`是getter函数返回的对象中的属性。因此,这段代码的意思是获取Vuex store中名为`TpmDeviceline`的状态数据。
相关问题
if (!this.$store.getters.data().TpmDevicePlantId && !this.$store.getters.data().TpmDeviceline) {},其中!是什么意思
`!`是JavaScript中的逻辑非运算符,用于将一个值转换为布尔值,并返回其相反值。在这个代码块中,`!`将`this.$store.getters.data().TpmDevicePlantId`和`this.$store.getters.data().TpmDeviceline`的值分别转换为布尔值,并返回它们的相反值。如果这两个值都为假(即为`false`),则条件表达式为真(即为`true`),执行花括号内的代码块。如果其中一个值为真(即为`true`),则条件表达式为假(即为`false`),不执行花括号内的代码块。
this.$store.getters.getPerms是undefined
你提到的代码 `this.$store.getters.getPerms` 返回了 `undefined`,这种情况可能是由于 `getPerms` 在 Vuex store 的 getters 中未定义引起的。请确保在你的 Vuex store 的 getters 中定义了名为 `getPerms` 的函数,并返回相应的值。另外,还需要确认你是否正确地在组件中调用了该 getter。如果以上方法都没有解决问题,可以提供更多的代码细节,以便我能够更好地帮助你。