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

A proper way to import it to a .vue file #20

Closed
Mirdrack opened this issue May 19, 2016 · 1 comment
Closed

A proper way to import it to a .vue file #20

Mirdrack opened this issue May 19, 2016 · 1 comment

Comments

@Mirdrack
Copy link

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
Copy link

hansnow commented May 20, 2016

the same problem

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