Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bkwld/vue-embed

Package Overview
Dependencies
Maintainers
7
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bkwld/vue-embed

Vue 2 embed component

  • 1.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
7
Weekly downloads
 
Created
Source

Vue Embed

A component that takes a plain text field with script tags and script links and parses

Props

  • html: The markup coming from the CMS
  • showLoading: When true, shows "Loading" on the front end while the external scripts are loading.

Usage

import Embed from '@bkwld/vue-embed'
Vue.component 'embed', Embed
vue-embed(:html='your_html_here')

Why use vue-embed?

vue-embed solves the problem of script tags not executing on client-rendered pages. Often these same script tags execute normally when the page is loaded via SSG. A common scenario for this is a CMS with an Embed Block that renders script tags to the front end, such as embedded videos or publisher tags.

How does vue-embed work?

  • On SSG and SSR, vue-embed renders the provided HTML code with the script tags removed.
  • On mounted, vue-embed finds all script tags with external URLs and appends them to the document head with async="true"
  • On mounted, vue-embed finds all script tags with inline code and executes them using eval().

FAQs

Package last updated on 20 Sep 2023

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc