Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacing prototype while setting objects #427

Closed
Otouto opened this issue Sep 13, 2014 · 2 comments
Closed

Replacing prototype while setting objects #427

Otouto opened this issue Sep 13, 2014 · 2 comments

Comments

@Otouto
Copy link

Otouto commented Sep 13, 2014

I`ve found weird behaviour in vue version >= 0.10.0:

new Vue({
    created: function() {
        console.log(moment()); //__proto__: Moment
        this.now = moment();
        console.log(this.now); //__proto__: Object
    }
})

why object`s prototype get replaced?

@yyx990803
Copy link
Member

Vue swaps observed data object's __proto__ property for faster method augmentations. In 0.11 you can turn off this behavior with Vue.config.proto = false.

@Otouto
Copy link
Author

Otouto commented Sep 16, 2014

In 0.11 you can turn off this behavior

It would be nice. Thanks for clarification.

@Otouto Otouto closed this as completed Sep 16, 2014
warpech added a commit to Palindrom/JSONPatcherProxy that referenced this issue Jul 29, 2019
because such problem happens in Vue 2 and it results in an invalid patch. See: vuejs/vue#427, vuejs/vue#9259
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants