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

vue 2.0中无法使用events,现在的版本是不是不支持2.0? #14

Closed
crazy0x opened this issue Oct 22, 2016 · 4 comments
Closed

Comments

@crazy0x
Copy link

crazy0x commented Oct 22, 2016

No description provided.

@crazy0x crazy0x changed the title vue 2.0中无法使用events,新的工程是不是不支持2.0? vue 2.0中无法使用events,现在的版本是不是不支持2.0? Oct 22, 2016
@lian-yue
Copy link
Owner

lian-yue commented Oct 23, 2016

@crazy0x vue 2.0 请使用
https://github.com/lian-yue/vue-upload-component/tree/2.0

2.0 的分支

@crazy0x
Copy link
Author

crazy0x commented Oct 23, 2016

@lian-yue 您好,我目前使用的是这个分支,但是events中的回调似乎都失效了,我要如何去注册并使用这些回调?

@lian-yue
Copy link
Owner

vue 2 不支持 events

vuejs/vue#2873
events deprecated, since no more event propaga

需要 events 作为属性传入 才行

var events  = {
  add(file, component) {
    console.log('add');
  }
}
<file-upload  :events=events></file-upload>

@crazy0x

@crazy0x
Copy link
Author

crazy0x commented Oct 23, 2016

@lian-yue 感谢解答,确实解决了问题,其实已经在example中写得很全了,是我没仔细看2.0分支的example。

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