无法获得.vue单个文件组件来使用NWjs

问题描述 投票:1回答:1

下午好,我正在使用NWjs在其0.26.1版本中制作桌面应用程序我正在使用Ubuntu服务器16.04和XfCE4开发应用程序我想使用Vue.JS作为数据部分,并为其UI组件提供buefy。但由于此UI Vue Framework使用单个文件.vue文件组件,因此我遇到此错误

Uncaught SyntaxError: Unexpected token <
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:600:28)
at Object.Module._extensions..js (module.js:653:10)
at Module.load (module.js:555:32)
at tryModuleLoad (module.js:518:12)
at Function.Module._load (module.js:510:3)
at Module.require (module.js:580:17)
at require (internal/module.js:11:18)
at self.require (<anonymous>:11:26)

我已经能够使用webpack生成一个没有问题的bundle js文件,但是NWjs坚持在单个文件组件中解析HTML标签。

模型组件如下

 <template>
    <section>
    <span>
    <b-field>
        <b-switch v-model="bars">Bars</b-switch>
    </b-field>
    <b-datepicker inline v-model="date" :events="events" indicators="indicators">
    </b-datepicker>
    </span>
  </section>
</template>

<script>
export default {

}
</script>
<style lang="sass" scoped>
</style>

对此有任何启示将是非常宝贵的帮助,在此先感谢。

vuejs2 vue-component buefy
1个回答
0
投票

使用Vue-cli和vue init解决。

© www.soinside.com 2019 - 2024. All rights reserved.