如何运行 运行 vue-text-highlight 基本用法?

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

我想 运行 来自 https://github.com/AlbertLucianto/vue-text-highlight 的基本用法部分的示例。我在 Firefox 中打开 index.html 时看到一个空白页面。

我使用的代码位于 https://github.com/michaelhochleitner/vue-text-highlight-basic-usage .

我采用了

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

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

为什么 index.html 不显示任何内容?

你不能像这样在 .js 文件中使用 import 语句。这是保留的语法,可将包转换为您的包随后可以使用的文件。我建议从 vue-cli 开始,这样您就可以处理一个成熟的 Vue 项目并 import/use 按照您描述的方式打包。