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

Mixins: props are not correctly mixed in when registered globally #3957

Closed
thenickname opened this issue Oct 16, 2016 · 2 comments
Closed

Mixins: props are not correctly mixed in when registered globally #3957

thenickname opened this issue Oct 16, 2016 · 2 comments
Labels

Comments

@thenickname
Copy link
Contributor

thenickname commented Oct 16, 2016

Vue.js version

2.0.2

Reproduction Link

https://github.com/thenickname/vue-global-mixin-bug

Steps to reproduce

Register a mixin with props globally:

Vue.mixin( {
  props : [ "myProp" ]
} );

Pass a prop value into any component:
<hello my-prop="foo"></hello>

What is Expected?

myProp becomes a prop of Hello.vue and the value of my-prop is "foo".

What is actually happening?

The value of my-prop is undefined

Notes

  • props are correctly mixed in if registered directly in the component using
    mixins : [ { props : [ 'myProp' ] } ]
  • default values are passed correctly but will never change
  • clone the provided git repository and run npm run dev to see the bug
    • repo contains two components "Hello.vue" and "HelloWithLocalMixin.vue" that demonstrate the apparently buggy behavior
    • also see App.vue and main.js
@thenickname thenickname changed the title Props are not corrently mixed in when registered globally Props are not correctly mixed in when registered globally Oct 16, 2016
@thenickname thenickname changed the title Props are not correctly mixed in when registered globally Mixins: props are not correctly mixed in when registered globally Oct 16, 2016
@LinusBorg LinusBorg added the 2.0 label Oct 18, 2016
@yyx990803 yyx990803 added the bug label Nov 1, 2016
@DotCoyote
Copy link

The bug is back in v2.1.8

@LinusBorg
Copy link
Member

Then please open a new issue with a reproduction. Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants