我想知道为什么 Vuex 中使用突变值 \xe2\x80\x8b\xe2\x80\x8bar "[]"。
类似的代码是什么""意思?
export const SOME_MUTATION = \'SOME_MUTATION\'
它只是函数的常量名称吗?如果是这样,我想知道为什么常量写在"[]".
另外,当在计算或方法属性中使用时,我想知道为什么您要将以下代码传递为而["SOME_ACTION"]不是"SOME_ACTION".
...mapActions(["SOME_ACTION"]),
考试代码
\n\nexport const SOME_MUTATION = \'SOME_MUTATION\'\n\nimport Vuex from \'vuex\'\nimport { SOME_MUTATION } from \'./mutation-types\'\n\nconst store = new Vuex.Store({\n state: { ... },\n mutations: {\n [SOME_MUTATION] (state) {\n }\n }\n})\nRun Code Online (Sandbox Code Playgroud)\n 我想在 ES6 中将多个函数导出为别名。
我像这样导出它,因为我想使用导出默认值,但“as”似乎不起作用。
const fn1 = () => {};
const fn2 = () => {};
export default = {
fn1 as function1,
fn2 as function2,
} // -> not working
Run Code Online (Sandbox Code Playgroud)
我怎样才能做我想做的事?