Skip to content
This repository was archived by the owner on Apr 20, 2018. It is now read-only.

rhyzx/vue-transfer-dom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Mar 22, 2016
d66a019 · Mar 22, 2016

History

6 Commits
Mar 21, 2016
Mar 21, 2016
Mar 22, 2016

Repository files navigation

vue-transfer-dom

requires Vue v1.0.19+

Transfer DOM to another place (eg. <body>).

Useful in some situations such as z-index management, see discussion here.

Demo (prevent modal overlap by other elements)

http://jsfiddle.net/rhyzx/br5cepu3/

Installation

npm install vue-transfer-dom

Usage

Vue.use(VueTransferDom /*, {name: 'transferDom'}*/)

new Vue({
  template: '<div v-transfer-dom>foo</div>', // div will be appended to body(default)
})

// append to specific place
new Vue({
  template: '<div v-transfer-dom:bar>foo</div>', // div will be appended to #bar(document.getElementById)
})