Skip to content
This repository was archived by the owner on Dec 1, 2023. It is now read-only.

Incorrectly registered installation method for Vue 2.x #1

Closed
DominikSerafin opened this issue Jun 20, 2017 · 1 comment
Closed

Incorrectly registered installation method for Vue 2.x #1

DominikSerafin opened this issue Jun 20, 2017 · 1 comment

Comments

@DominikSerafin
Copy link
Contributor

DominikSerafin commented Jun 20, 2017

Hello @steffans!

This library is what I was looking exactly for, thank you for creating it! The API is exactly what I want. But there's one problem... It doesn't work with Vue 2.x.

It doesn't work loaded directly using <script> and it doesn't work in webpack build when imported.

Fiddle: https://jsfiddle.net/egjru2wq/2/

EDIT1: Upon further investigation of $events.listeners it seems like the listeners aren't registered at all because I can't see my 'test' event listener there.

EDIT2: Yep. The problems lies in registering event listeners in events property. See updated fiddle: https://jsfiddle.net/egjru2wq/3/

EDIT3: I think I've pinpointed the issue. I think the mixin is incorrectly installed. First of all the plugin installation method isn't exposed in install method (Writing a Plugin) and the second main thing is that mixin is registered on init (index.js:18) instead of beforeCreate (Migration from Vue 1.x - init renamed). — I'd create pull request myself but I don't have any experience in plugins that are backward compatible with Vue 1.x.

EDIT4: For reference - here's my modified dist/vue-event-manager.common.js that I'm now using (and it works!) with Vue 2.x: https://hastebin.com/qivukanoka.js

@DominikSerafin DominikSerafin changed the title Simply doesn't work with Vue@ Simply doesn't work Jun 20, 2017
@DominikSerafin DominikSerafin changed the title Simply doesn't work Simply doesn't work on Vue 2 Jun 20, 2017
@DominikSerafin DominikSerafin changed the title Simply doesn't work on Vue 2 Simply doesn't work with Vue 2.x Jun 20, 2017
@DominikSerafin DominikSerafin changed the title Simply doesn't work with Vue 2.x Incorrectly registered installation method for Vue 2.x Jun 20, 2017
steffans pushed a commit that referenced this issue Jun 21, 2017
@steffans
Copy link
Member

Thanks, fixed in v1.0.3

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

No branches or pull requests

2 participants