0

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?

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. I managed to run the example using vue-cli. Example project: github.com/michaelhochleitner/tat1 .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.