I have a vue-cli-3 project, but i'd like to add a static javascript file, but I don't know how import this file.
the traditional way is:
<script src="js/myfile.js"></scrip>
I have a vue-cli-3 project, but i'd like to add a static javascript file, but I don't know how import this file.
the traditional way is:
<script src="js/myfile.js"></scrip>
Place your file (myfile.js) inside your src directory, for example in assets. In your src/App.vue file add in the script portion:
import './assets/myfile.js';
Note that you can technically put your file in public and reference it from your index.html like you usually do. It will work. But it's not the recommended approach.