0.1.2 • Published 4 years ago

vue-ext-files-head-loader v0.1.2

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

External Files Head Loader

A VueJS plugin for loading external JS/CSS inside VueJS environment. I created this since some of my projects need to load external scripts inside the VueJS script.

Demo: Demo

Install

npm install --save vue-ext-files-head-loader

Include the plugin in main.js

Add the following in main.js

import HeadLoader from "vue-ext-files-head-loader";

Vue.use(HeadLoader);

Define the resources files (external files to be loaded)

const resources = [
  {
    host: "https://cdnjs.cloudflare.com/ajax/libs/",
    jsLibrary: [
      "jquery/3.5.1/jquery.js",
      "tether/1.4.7/js/tether.js",
      "bootstrap-material-design/4.0.2/bootstrap-material-design.iife.js",
    ],
    cssLibrary: [
      "bootstrap-material-design/4.0.2/bootstrap-material-design.css",
      "tether/1.4.7/css/tether.min.css",
    ],
  },
];

Then call the following to load:

this.$head.load(resources).then(() => {
  // Load Successfully
});
0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago