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

Merging doesn't appear to be symmetrical #7

Closed
jchive opened this issue Oct 12, 2017 · 1 comment
Closed

Merging doesn't appear to be symmetrical #7

jchive opened this issue Oct 12, 2017 · 1 comment

Comments

@jchive
Copy link

jchive commented Oct 12, 2017

Using this in a component with a keypress event,

<input text="text" on-keypress={this.keypress} v-model={this.d} />

works correctly and the keypress event is called and the model is bound

however

<input text="text" v-model={this.d} on-keypress={this.keypress} />

causes

Uncaught TypeError: Cannot read property 'apply' of undefined
at eval (index.js?9ef6:52)
at HTMLInputElement.invoker (vue.esm.js?efeb:1821)

Error

which I traced to a.apply(this.arguments) in

function mergeFn (a, b) {
  return function () {
    a.apply(this, arguments)  
    b.apply(this, arguments)
  }
}

So there is implication that the order of the attribute declarations is causing a difference of outcome in the mergeJSXProps function, where I would expect the outcome from the function would be the same?

(The v-model attribute is being supplied by the "babel-plugin-jsx-v-model" plugin).

@jchive
Copy link
Author

jchive commented Oct 12, 2017

On further inspection this may be down to the interaction with the babel-plugin-jsx-v-model plugin.

@jchive jchive closed this as completed Oct 12, 2017
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

1 participant