A proper way to import it to a .vue file
Mirdrack opened this issue · 1 comments
Mirdrack commented
Hello!
Could you pleas tell me how is the proper way to include the package where you are working with .vue files?
I just create a project with vue-cli
$ npm install -g vue-cli
$ vue init webpack my-project
$ cd my-project
$ npm install
$ npm run dev
And this is my component
<template>
<div class="autocomplete">
</div>
</template>
<script>
VueTypeaheadMixin = require('vue-typeahead');
export default {
mixins: [VueTypeaheadMixin],
ready () {
console.log('Autocomplete');
},
}
</script>
<style type="text/css">
</style>
But I'm receiving
vue-typeahead.js?51da:1 Uncaught SyntaxError: Unexpected token import
This error when the webpack tries to transpile the code
How can avoid this?
If you need more information just let me know, thanks in advance
hansnow commented
the same problem