Socket
Socket
Sign inDemoInstall

vue-script-component

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-script-component

A vuejs component to easily load scripts as a vue component


Version published
Weekly downloads
293
increased by33.18%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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
  • Usage
  • Demo

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.

Keywords

FAQs

Package last updated on 04 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc