Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-window-size

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-window-size

Reactivity window size for Vue.js.

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.2K
decreased by-6.82%
Maintainers
1
Weekly downloads
 
Created
Source

vue-window-size

npm version License: MIT

Reactivity window size for Vue.js

Install

$ yarn add vue-window-size

Usage

Plugin or Mixin.

Plugin all components have window sizes.

Components with mixin have window sizes. Other components don't have window sizes.

Plugin

Install plugin

import Vue from 'vue';
import VueWindowSize from 'vue-window-size';
 
Vue.use(VueWindowSize);

Use with component

<template>
  <div>
    <p>window width: {{ windowWidth }}</p>
    <p>window height: {{ windowHeight }}</p>
  </div>
</template>

Mixin

Use with component

<template>
  <div>
    <p>window width: {{ windowWidth }}</p>
    <p>window height: {{ windowHeight }}</p>
  </div>
</template>

<script>
import { vueWindowSizeMixin } from 'vue-window-size';

export default {
  mixins: [vueWindowSizeMixin],
};
</script>

Options

delay (option)

  • type: Number
  • default: 50

Change delay time of resize event.

e.g.

import Vue from 'vue';
import VueWindowSize from 'vue-window-size';

Vue.use(VueWindowSize, {
  delay: 100,
});

Public API

setDelay(delay: number)

Same as deplay option.

import { vueWindowSize } from 'vue-window-size';

vueWindowSize.setDelay(1000);

Keywords

FAQs

Package last updated on 21 Dec 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc