Osvald Laurits
Osvald Laurits

Reputation: 1364

How to run run vue-text-highlight basic usage?

I want to run an example from the basic usage section of https://github.com/AlbertLucianto/vue-text-highlight . I see a blank page when I open index.html in Firefox.

The code I'm using is at https://github.com/michaelhochleitner/vue-text-highlight-basic-usage .

I took the syntax for

<script>
module.exports = {
    data: function () {
        return {
            queries: ['birds', 'scatt'],
            description: 'Tropical birds scattered as Drake veered the Jeep'
        };
    }
}
</script>

from https://v2.vuejs.org/v2/guide/single-file-components.html .

Why does index.html not display anything?

Upvotes: 0

Views: 153

Answers (1)

belvederef
belvederef

Reputation: 2293

You cannot use import statements in .js files like that. That is reserved syntax that converts a package in files that your bundle can then use. I recommend getting started with the vue-cli so that you can work on a fully-fledged Vue project and import/use packages the way you described.

Upvotes: 2

Related Questions