Skip to content
This repository has been archived by the owner on Apr 20, 2022. It is now read-only.

Events options not registering on Vue 2.2.1 #8

Closed
dvatp opened this issue Mar 3, 2017 · 4 comments
Closed

Events options not registering on Vue 2.2.1 #8

dvatp opened this issue Mar 3, 2017 · 4 comments

Comments

@dvatp
Copy link

dvatp commented Mar 3, 2017

While experimenting with:

https://github.com/ratiw/vuetable-2-tutorial-bootstrap/tree/master/src

and running Vue 2.2.1 (latest as of this date).

This is basically a Vue equivalent to the DataTables jquery plugin that uses vue-events. In simple terms, this consists of a Vuetable component which displays some data in a table and a FilterBar component which allows the user to enter some search criteria (free-form text).

The FilterBar is organized as a child of the Vuetable component. When the user types data into the search field and clicks "go" a custom event called "filter-set" is emitted. The parent Vuetable component uses vue-events to listen to that event and fetch new data and reload the table.

The problem is that, although the FilterBar is in fact emitting the event, the Vuetable component would not respond to the event and reload the table.

I traced the problem to a conditional in vue-events (index.js) that is apparently trying to determine whether the installation is Vue 1.x or 2.x. When I comment out that conditional and just let the Vue.mixin() call run, everything works.

I'm new to Vue so I don't fully understand Vue internals in depth yet, but it's clear something has changed such that Vue.prototype._mount does not exist (or more technically isn't considered a function) so the test fails and nothing is registered. That logic needs some work.

@cklmercer
Copy link
Owner

Thank you for the detailed bug report!

I've published a new version of vue-events which removes the conditional. That conditional was probably unnecessary, given that Vue 1.0 doesn't even use the beforeCreate life-cycle hook.

@dvatp
Copy link
Author

dvatp commented Mar 3, 2017

Thanks for the rapid fix. FYI, I pulled in vue-events via npm, so if you are pushing out a package as part of this process I'll update and verify the fix.

@cklmercer
Copy link
Owner

I did indeed publish the new version to npm. 3.0.1 is the current latest. Verification would be much appreciated!

@dvatp
Copy link
Author

dvatp commented Mar 3, 2017

Updated via npm and verified the fix works. Little more than a half hour from initial report, to fix, to integration test of the fix. This is how open-source should be done. Thanks again!

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