FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

getpu/vue-plugin-load-script: A Vue plugin for injecting remote scripts. · GitHub

 
 

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

vue-plugin-load-script

A Vue plugin for injecting remote scripts.

Install

# npm
npm install --save-dev vue-plugin-load-script
# yarn
yarn add --dev vue-plugin-load-script

Use

  // In main.js
  import LoadScript from 'vue-plugin-load-script';

  Vue.use(LoadScript);
  // In any component or function
  Vue.loadScript("https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY")
    .then(() => {
      // Script is loaded, do something
    })
    .catch(() => {
      // Failed to fetch script
    });

About

A Vue plugin for injecting remote scripts.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages


Back | FazBrowse Home | New Git URL