Socket
Socket
Sign inDemoInstall

pikaz-iframe

Package Overview
Dependencies
11
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    pikaz-iframe

A Iframe Component for Vue.js


Version published
Weekly downloads
17
increased by21.43%
Maintainers
1
Install size
12.8 MB
Created
Weekly downloads
 

Readme

Source

Introduction

基于vue封装的一个iframe插件

Features

  • 带有默认设置,方便使用iframe,可设置是否隐藏滚动条,修改传入的HTML内容样式等。

demo

demo代码

Installation

With npm or yarn

yarn add pikaz-iframe

npm i -S pikaz-iframe

For Vue-cli

<pikaz-iframe :setting="setting">
</pikaz-iframe>

.vue file:

  import {PikazIframe} from 'pikaz-iframe'
  ...
  export default {
        components: {
            PikazIframe,
        },
        data () {
          return {
            setting:{
              src: "https://m.baidu.com/",
              onload: ()=> {
                console.log("载入成功")
              }
            }
          }
        }
  ...
setting参数:
参数说明类型可选值默认值
frameborder是否显示框架周围的边框number0/10
sandbox启用iframe中内容的额外限制,传入空字符串则对所有权限做限制,具体查看MDN-iframestring""/allow-forms/allow-same-origin/allow-scripts/allow-top-navigation等传入src时默认为"allow-same-origin allow-scripts",传入srcdoc时默认为"allow-scripts"
src被嵌套的页面的 URL 地址string----
srcdochtml内容string----
hideScrolling是否隐藏滚动条,传入true默认隐藏18px宽的滚动条,如需隐藏其他宽度滚动条,则传入宽度如"20px"boolean/string--false
onloadiframe加载完成时的钩子funtion----
css传入html内容时,需修改的css样式,如"div{color:red;}"string----
更多设置选项请查看MDN-iframe
Events
事件名称说明回调参数
onloadiframe加载完成时触发--

Keywords

FAQs

Last updated on 05 Jun 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc