-1👍
You must just not wrap the content of the .js
-file with script
tags, since you are not writing this code in an HTML file. You do already specify to use javascript code by importing the file in <script setup />
, so the compiler knows that the content of the .js
-file contains JavaScript code.
It is similar to the CSS
-file: Just delete the HTML-tags (<script>
and </script>
) from the beginning and the end of the .js
-file, and you should be fine.
If this does not work, the error message says that script setup
cannot be used with external file imports, so you might be forced to write the JavaScript code directly into your .vue
-component-file.
👤STh
- [Vuejs]-Vue/Laravel – uploading a file on update doesn't work
- [Vuejs]-Vuejs and jqueryui with browserify
Source:stackexchange.com