1.0.4 • Published 6 years ago

window-plugin v1.0.4

Weekly downloads
2
License
ISC
Repository
-
Last release
6 years ago

The Vue WindowPlugin adds $window and $document DOM objects to each Vue component. This is helpful when accessing DOM from attribute templates. allowing you to call DOM methods without declaring a method.

For example, you can open alerts, log events, or open URLs in new tabs.

Usage

<button @click='$window.alert("You clicked a button.")'>Click Me</button>
<button @click='$window.console.log("A button was clicked.")'>Click Me</button>
<button @click='$window.open("https://www.quickchords.org/", "_blank"))'>Click Me</button>
<h1 :v-text='$document.title' />

Installation

Install the package via NPM

npm install --save window-plugin

Install the plugin before creating your Vue

import Vue from 'vue'

import WindowPlugin from 'window-plugin'
Vue.use(WindowPlugin)

new Vue({
    // your code here
})

Dependencies

None

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2-h

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago