[Vuejs]-Passing data to the modal in Vue not working

1👍

The problem is that you are trying to use document in the created handler of the component which is far too early in its life-cycle.

Instead, one approach is to use a watch handler in your UserModal like this:

watch: {
    document: function () {
        console.log(this.document);
        if (this.document) {
            this.fetchUsers(this.document);
        }
    }
}

0👍

Try to declare your prop like so:

props: {
  document: Object
}

Leave a comment