How do you understand this way of writing the mutations constant in vue?

/ / mutation-types.js
export const SOME_MUTATION = "SOME_MUTATION"
/ / store.js
import Vuex from" vuex"
import {SOME_MUTATION} from". / mutation-types"

const store = new Vuex.Store ({
state: {.},
mutations: {

)
[SOME_MUTATION] (state) {
  // mutate state
}

}
})

What does the word "[SOME_MUTATION]" of mutations in

store mean and how do you understand it? Why add square brackets?

Mar.05,2021

ES6 allows you to literally define an object using method two (expression) as the property name of the object, that is, placing the expression in square brackets.

this is the way es6 is written, and when converted to es5, this is

.
  getting started with ECMAScript 6-object extension  

Menu