简体   繁体   中英

How to use components in my custom js file in Laravel and Vue.js?

I'm new to Laravel and Vue.js. I created a simple Laravel/Vue.js project like this post: https://itsolutionstuff.com/post/laravel-5-and-vue-js-crud-with-pagination-example-and-demo-from-scratchexample.html

Now I want to add date-picker to my blade files: https://talkhabi.github.io/vue-persian-datetime-picker/#/installation

However, when I import component to my js file (for example item.js ), I get the following error message:

SyntaxError: import declarations may only appear at top level of a module.

Your import statements must come first at the beginning of your JS files. No import statements should come after regular code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM