# vue-render-to

> vue directive to render to element with provided id

Latest version **1.0.2** (published 2017-12-03) · ISC license · 0 weekly downloads

## Install

```sh
npm install vue-render-to
pnpm add vue-render-to
yarn add vue-render-to
bun add vue-render-to
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2017-12-03 |
| First published | 2017-12-03 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | HelloDeadline |
| Maintainers | hellodeadline |

## Links

- npm: https://www.npmjs.com/package/vue-render-to
- Repository: https://github.com/HelloDeadline/vue-render-to
- Homepage: https://github.com/HelloDeadline/vue-render-to#readme
- Issues: https://github.com/HelloDeadline/vue-render-to/issues
- npm.io page: https://npm.io/package/vue-render-to

## Recent versions

- 1.0.2 (latest) — 2017-12-03
- 1.0.1 — 2017-12-03
- 1.0.0 — 2017-12-03

## README

# vue-render-to

Vue directive that renders element to another element (by id) located anywhere in the DOM.

Moved component keeps all bindings and behaves like normal Vue component.

Destination id can be changed dynamically.

## Installation

### Install package

```shell
npm install vue-render-to --save
```

### Install directive

```js
import RenderToDirective from "vue-render-to";

Vue.directive("render-to", RenderToDirective);
```

## Usage

Provide id of destination element in the directive:

```html
<div v-render-to="'destination-id'">My awesome div</div>
```

If destination element doesn't exist in the DOM, you will get warning in console and div won't be
moved.

### Supported modifiers:

#### `prepend`

```html
<div v-render-to.prepend="'destination-id'">My awesome div</div>
```

When not provided, appendChild method will be used by default

## Extending code

You can write your own directive based on code of this directive.

For that you can extend directive's class:

```js
import { RenderTo } from "vue-render-to";

class MyDirective extends RenderTo {
  // Your code
}
```

---
_Source: https://npm.io/package/vue-render-to · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
