What does the function-style code that begins with brackets in mutations.js 's export default mean?

Secondary development (undocumented and unaccompanied) sees a string of

in the code related to one of the vue modules in the project.

types.SET_ACTIVE_TAB I found it in the reference file mutation_types.js . The result is

.
export default {
    SET_ACTIVE_TAB: "SET_ACTIVE_TAB",
};

I"d like to ask you guys why the type.SET_ACTIVE_TAB in the front part of this function-like format should be enclosed in square brackets. What are these brackets for?

Apr.25,2021

Parentheses in

mean that the key of the object is a variable. Export a method named SET_ACTIVE_TAB

the final result is

export default {
    SET_ACTIVE_TAB(state, tab) {
        ...
    }
}

this is ES6 style calculated attribute naming
refer to
ide/mutations.html" rel=" nofollow noreferrer "> use constants instead of Mutation event types
attribute name expression

  • Vue promise

    data request uses axios method of requesting data print out, first execute the new acquisition data, and then perform the re-acquisition data, so that the data is still the same as before. Is there any way to add the acquisition data after the ...

  • Es6 Arrow expression this

    for example, I wrote const fn = () = > { this in test.js how to get this this to get the vue object? } export default fn then in the vue file import test from test test.fn.bind (this) () but what if the this in fn is not a pointing vue ob...

    Aug.17,2021
Menu