Skip to content

$store is undefined in Modal #4560

@yxc888

Description

@yxc888
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

undefined

Environment

Chrome

Reproduction link

https://antdv.com/docs/vue/introduce/

Steps to reproduce

Firstly, define a component A which use vuex.

Then, use function Modal.confirm,
Modal.confrim({
content: h => ,
})

What is expected?

get $store correctly

What is actually happening?

TypeError: Cannot read property 'state' of undefined
at VueComponent.mappedState (vuex.esm.js?2f62:945)
at Watcher.get (vue.esm.js?a026:4488)

When i console.log(this.$store) in A, it show undefined.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions