New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

vue-teleport-pro

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-teleport-pro

use teleport like a pro, supports vue2 and vue3

latest
Source
npmnpm
Version
0.9.1
Version published
Maintainers
1
Created
Source

Vue Teleport Pro

  • 类似 vue3 的 teleport 组件,不过不受生命周期限制,可以套在 v-if 内。
  • 兼容 vue2 和 vue3
  • 代码少,小巧灵活,性能不减

Installation

执行以下命令安装:

npm i vue-teleport-pro

Usage

props

{
  to: string // 目标 element selector
}

example

<template>
  <div>
    <template v-if="showTeleport">
      <teleport-pro to="#target">
        <button>我是teleport内容,统计: {{ count }}</button>
      </teleport-pro>
    </template>
    <div style="border: 1px solid #000; width: 100px; height: 100px">
      我是目标盒子 {{ count }}
      <div id="target"></div>
    </div>
    <button @click="showTeleport = !showTeleport">
      显示或隐藏teleport内容
    </button>
    <button @click="count += 1">点击更新teleport内容</button>
  </div>
</template>

<script>
import TeleportPro from "vue-teleport-pro";

export default {
  components: {
    TeleportPro,
  },
  data() {
    return {
      count: 0,
      showTeleport: true,
    };
  },
};
</script>

例子效果请看: https://codesandbox.io/s/vue-teleport-pro-example-o19vq?file=/src/App.vue

Downloading directly from CDN

<!-- jsdelivr cdn (推荐) -->
<script src="https://cdn.jsdelivr.net/npm/vue-teleport-pro@latest"></script>

<!-- 或者 unpkg cdn -->
<!-- <script src="https://unpkg.com/vue-teleport-pro@latest"></script> -->

<script>
  const TeleportPro = window.TeleportPro
  // write your code here
</script>

Keywords

elements

FAQs

Package last updated on 09 Feb 2022

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