vue-script-component

A vuejs component to easily load scripts as a vue component
19,016 33
Install
npm install vue-script-component
Latest Version:0.1.7
Vue:2
License:MIT
Last Updated:Dec 10, 2022
Links: GitHub  ·  npm
Maintainer: dynomike

Vue Script Component

A component to enable scripts to be loaded within the template tags of a .vue file.

Since I couldn't find a generic VueJS component to load ads, I made my own. While this component was initially built to load third-party ads, it should be able to load any javascript your pretty little hearts desire.

Table of Contents

Installation

npm install vue-script-component

Usage

Find a *.vue file that you want to load a script in, and...

<template>
    <div>
        <VueScriptComponent script='<script type="text/javascript"> alert("Peekaboo!"); </script>'/>
    <div>
</template>

<script>
import VueScriptComponent from 'vue-script-component'

export default {
  ...
  components: {
    ...
    VueScriptComponent
  }
  ...
}
</script>

Demo

You can find this approach being used in one of my websites https://imgsurv.com . It's a temporary image hosting site to help share images between people no matter the platform. The ads shown on the site are from Propeller at the time of writing.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Related Packages

vue-adsense

Google Adsense for Vue

1,329 77
@enso-ui/google

Google integration settings pages for Enso UI

8,808 0
lighthouse-stack-packs

Lighthouse Stack Packs

142,086,521 219
vue-google-autocomplete

Vue component to Google Places Autocomplete

1,307,599 502
vue-google-pay

Google Pay component for Vue

10,473 6

Version History

Version Released License
0.1.7 MIT
0.1.6 MIT
0.1.5 MIT
0.1.4 MIT
0.1.3 MIT