vue.js – laravel5.2+vue1.0, Verwendung von Vue-Komponenten, Meldung von Fehlern bei Verwendung von gulp
大家讲道理
大家讲道理 2017-05-16 16:47:19
0
1
606

Der folgende Fehler wird beim Ausführen von gulp gemeldet:

[07:11:05] gulp-notify: [Laravel Elixir] Browserify Failed!: Parsing file /home/vagrant/Code/TaskManager/resources/assets/js/vue/components/stepList.vue: 'import' and 'export' may appear only with 'sourceType: module' (22:0)
{ Error: Parsing file /home/vagrant/Code/TaskManager/resources/assets/js/vue/components/stepList.vue: 'import' and 'export' may appear only with 'sourceType: module' (22:0)
    at Deps.parseDeps (/home/vagrant/Code/TaskManager/node_modules/module-deps/index.js:437:28)
    at fromSource (/home/vagrant/Code/TaskManager/node_modules/module-deps/index.js:376:44)
    at /home/vagrant/Code/TaskManager/node_modules/module-deps/index.js:370:17
    at ConcatStream.<anonymous> (/home/vagrant/Code/TaskManager/node_modules/concat-stream/index.js:36:43)
    at emitNone (events.js:91:20)
    at ConcatStream.emit (events.js:185:7)
    at finishMaybe (/home/vagrant/Code/TaskManager/node_modules/readable-stream/lib/_stream_writable.js:460:14)
    at endWritable (/home/vagrant/Code/TaskManager/node_modules/readable-stream/lib/_stream_writable.js:469:3)
    at ConcatStream.Writable.end (/home/vagrant/Code/TaskManager/node_modules/readable-stream/lib/_stream_writable.js:436:5)
    at DuplexWrapper.onend (/home/vagrant/Code/TaskManager/node_modules/readable-stream/lib/_stream_readable.js:537:10)
Der

.vue-Dateicode lautet wie folgt:

<template>
    <li class="list-group-item">
        <span @dblclick="editStep(step)">{{ step.name }}</span>
        <span class="pull-right">
            <i class="fa fa-check " @click="toggleCompletion(step)"></i>
            <i class="fa fa-close " @click="removeStep(step)"></i>
        </span>
    </li>
</template>

<script>
    export default {
        props:['step']
    }
</script>

<style>
</style>

Entschuldigung, was ist los?

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

Antworte allen(1)
PHPzhong

在根目录新建 .babelrc 输入一下内容

{
  "presets": ["es2015", "stage-0"]
}
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage