vue2-teleport

1.1.2 • Public • Published

vue2-teleport

npm version

This package is an alternative to vue3's teleport component. You can use the documentation provided by vue as a starting point to using this package.

Example

<template>
  <div>
      <button @click="modalOpen = true">
          Open full screen modal! (With teleport!)
      </button>
    
      <Teleport to="body">
        <div v-if="modalOpen" class="modal">
          <div>
            I'm a teleported modal! 
            (My parent is "body")
            <button @click="modalOpen = false">
              Close
            </button>
          </div>
        </div>
      </Teleport>
  </div>
</template>

<script>
import Teleport from 'vue2-teleport';

export default {
  components: {
    Teleport,
  },
  data() {
    return { 
      modalOpen: false
    }
  }
}
</script>

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.2
    497
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.2
    497
  • 1.1.1
    183
  • 1.1.0
    48
  • 1.0.1
    10,497
  • 1.0.0
    3

Package Sidebar

Install

npm i vue2-teleport

Weekly Downloads

10,818

Version

1.1.2

License

none

Unpacked Size

63.9 kB

Total Files

11

Last publish

Collaborators

  • mechazawa