-
Notifications
You must be signed in to change notification settings - Fork 43
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
import VueFuse #45
Comments
Sorry for the long delay on this! Were you able to get around this issue? If not, which version are you using? And would you mind posting a sample of your main.js? Cheers! |
Same problem here. Getting error Using |
Can you send me your main.js? I can't replicate |
main.js:
App.vue:
This is following the documentation. Gives the error Moving the |
@shayneo from what i can look at the source you have a few issues with main file ( https://github.com/shayneo/vue-fuse/blob/master/src/index.js#L12-L13 That beeing said your entry file should at least // Your src/index.js file
import Vue from 'vue'
import VueFuse from './components/VueFuse.vue'
import Fuse from 'fuse.js'
/*
*an install function, y
*/
const install = function (Vue, options) {
Vue.component(VueFuse.name, VueFuse)
Vue.prototype.$search = function (term, list, options) {
return new Promise(function (resolve, reject) {
var run = new Fuse(list, options)
var results = run.search(term)
resolve(results)
})
}
}
VueFuse.install = install
export default VueFuse;
// OR OBJECT FLAVOUR
const Plugin = {
install: function (Vue, options) {
// same as above
}
}
export default Plugin;
// or also exporting an object including the Components to be use locally (see link to Portal) There's a lot of other ways to do it, but i'm pretty sure you know about it and just forgot to add them. I was just passing by while searching for fuse vue wrappers. Sry for the long post. |
Fix in progress here: https://github.com/shayneo/vue-fuse/tree/fix-install-method Having some issues with the bundle step with vue-cli... will update when resolved |
Should be fixed in 2.1.0, please let me know if issues continue. Thanks!! |
I'm not sure its my fault or not, but
import VueFuse from 'vue-fuse'
does't work for me. I had to import it directly:
import VueFuse from 'vue-fuse/src/components/VueFuse
The text was updated successfully, but these errors were encountered: