【发布时间】:2019-06-26 02:59:32
【问题描述】:
我正在尝试在我的模板中导入 vuejs-datepicker,但它不起作用。我没有看到任何结果,如果我查看控制台,它会显示:Uncaught SyntaxError: Unexpected identifier。难道我做错了什么?是不是刀片模板中无法导入?
registration.blade.php:
@section('content')
...
<div class="col-lg-3 col-md-6">
<div class="form-group">
<label for="yearOfBirth">YEAR OF BIRTH*</label>
<datepicker></datepicker>
</div>
</div>
...
@endsection('content')
@endsection('content')
@section('scripts')
<script>
import Datepicker from 'vuejs-datepicker';
new Vue({
el: '#form',
data: {
name: 'Your horse',
items: []
},
methods: {
addVideo(){
this.items.push({
value: ''
});
},
deleteVideo(index){
this.items.splice(index,1);
}
},
components: {
Datepicker: Datepicker
}
});
</script>
@endsection
【问题讨论】:
-
控制台中
Unexpected identifier之后的内容是什么? IE。它是否说明了意外的字符是什么字符? -
它说“意外的标识符”。
-
vue 控制台呢?
-
Firefox 控制台是这样说的:SyntaxError:导入声明可能只出现在模块的顶层。 Vue 开发工具似乎不起作用。