How vue uses evaluation attributes in expressions

there is a problem when using vuex:

for example, do you have to go through this.code==this.$store.state.code to determine whether the code in the component is equal to the code, in vuex? (it"s too long to write)

but after reading the official documents, the calculation properties are all in double parentheses {{}}

.

so there is no way to use evaluation attributes in expressions.
implement this.code==computedCode

Feb.28,2022

Computing attributes can be used directly. Could you have used them incorrectly?


computed: {
   code2 () {
     ruturn this.$store.state.code
   }
}
This.code = code2 in

expression


your question, I mean, the question itself is the answer, okay? If you want to use computed, in an expression, just use it.


ide/getters.html-sharp%E9%80%9A%E8%BF%87%E6%96%B9%E6%B3%95%E8%AE%BF%E9%97%AE" rel=" nofollow noreferrer "> access through method

Menu