[Vuejs]-How can i add javascript tag file to Vue

0👍

Well, you could do either one of the following:

<template>
  <div>
    <!-- the template -->
  </div>
</template>

<script>
  import "assets/homepage/js/plugin.js";
  import "assets/homepage/js/fullsreen-showcase.js";
  import "assets/homepage/js/main.js";

  // Or if those files are modules
  // import Something from "assets/homepage/js/plugin.js";
  // ...

  export default {
    // ...
  }
</script>

Or:

<template>
  <div>
    <!-- the template -->
  </div>
</template>

<script src="assets/homepage/js/main.js"></script>

main.js

Import the rest of the JS files, considering main.js as the entry point.

import "assets/homepage/js/plugin.js";
import "assets/homepage/js/fullsreen-showcase.js";

export default {
  // ...
}

Leave a comment