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

Uncaught ReferenceError: _vue is not defined #66

Open
rajatonit opened this issue Nov 12, 2017 · 1 comment
Open

Uncaught ReferenceError: _vue is not defined #66

rajatonit opened this issue Nov 12, 2017 · 1 comment

Comments

@rajatonit
Copy link

Hi I'm getting the error: Uncaught ReferenceError: _vue is not defined when using the component...

This is where it fails:

fetch: function() {
var e = this;
if (!this.$http) {
return _vue.util.warn('You need to provide a HTTP client', this) <---
}
if (!this.src) {
return _vue.util.warn('You need to set the src property', this)
}
var t = this.queryParamName ? this.src : this.src + this.query
, n = this.queryParamName ? (0,
_assign2.default)((0,

Any help to solve this would be great.

Thanks.

@nick-dasilva
Copy link

Hi, I ran into this error too. The quickstart guide in the main Readme isn't very clear on this, but you need to do a couple of things to get the component to work. Your main.js file needs to have the TypeAhead component registered with your Vue instance, and the Vue prototype needs to have an "$http" field that points to an instance of Axios or some other browser-side HTTP client.

This is visible here:
https://github.com/pespantelis/vue-typeahead/blob/master/demo/Typeahead.vue

Note lines 3, 5, and 10.

I doubt that this fixes the actual issue of _vue.util being undefined, but at least it will get your fetch() calls working.

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