Skip to content

Cannot convert a Symbol value to a string #303

Closed
@guoerwei

Description

@guoerwei

尝试了在 mutation-types.js 里定义的时候,使用Symbol(),比如SOME_ACTION=Symbol()

在actions里面dispatch会是成功的,

const test = ({dispatch}, action) => { dispatch(SOME_ACTION), action };

但是在非actions里,比如我参考vux,在router那边使用了dispatch来操作。

store.dispatch(SOME_ACTION, param)

这个时候就会报出Cannot convert a Symbol value to a string,如果不用Symbol()就可以

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions