1.0.1 • Published 4 years ago

vue-resize v1.0.1

Weekly downloads
185,189
License
MIT
Repository
github
Last release
4 years ago

vue-resize

npm npm vue2

Detect DOM element resizing

JSFiddle

Sponsors

sponsors logos

Installation

npm install --save vue-resize

Module import

⚠️ You need to include the package CSS:

import 'vue-resize/dist/vue-resize.css'

Then import the package and install it into Vue:

import Vue from 'vue'
import VueResize from 'vue-resize'

Vue.use(VueResize)

Or:

import Vue from 'vue'
import { ResizeObserver } from 'vue-resize'

Vue.component('resize-observer', ResizeObserver)

Browser

<link rel="stylesheet" href="vue-resize/dist/vue-resize.css"/>

<script src="vue.js"></script>
<script src="vue-resize/dist/vue-resize.min.js"></script>

The plugin should be auto-installed. If not, you can install it manually:

Vue.use(VueResize)

Or:

Vue.component('resize-observer', VueResize.ResizeObserver)

Usage

Add the <resize-observer> inside a DOM element and make its position to something other than 'static' (for example 'relative'), so that the observer can fill it.

Listen to the notify event that is fired when the above DOM element is resized.

Example

<template>
  <div class="demo">
    <h1>Hello world!</h1>
    <resize-observer @notify="handleResize" />
  </div>
</template>

<script>
export default {
  methods: {
    handleResize ({ width, height }) {
      console.log('resized', width, height)
    }
  }
}
</script>

<style scoped>
.demo {
  position: relative;
}
</style>

License

MIT

@ropez/vue-virtual-scrollerbb-chatv-tooltip-ssr@yjl9903/v-tooltip@clicdata/vue-virtual-scrollerlingxing-uieasis@infinitebrahmanuniverse/nolb-vue-r@everything-registry/sub-chunk-3090tdh-element-uitempsensw-longteng-vue-virtual-scrollervunemesis-vue-virtual-scrollerworksafe-component-libraryxd-vue-googlemapswg-video-playerxinya-tablernl-vue-virtual-scrollersedanbosoksequence-browservue-googlemapsvue-cordova-scrollerv-nav-barv-tooltipv-tooltip-ssr-testvue-expandable-gridvue-fixed-blockvue-fluid-scrollvue-fake-scrollmingx64-vue3-vs-testjscatalystlzm-virtual-listmacwk-tooltipk-directiveskolach-vue-virtual-tablekodexa-vuekfront-baseuimangudinlagirajinpileuleuyanteapit-element-uipatepangdeuirainbowprokovanmailssr-virtual-scrollertehmusimhujanshrimp-vue-componentstx-drawer@asd20/ui@artesa/floating-vue@anny.co/floating-vue@atom525824/vue-virtual-scroller@akryuminfinitum/vue-virtual-scroller@bazuka5801/floating-vue@byzanteam/brick@cchen028/vue-virtual-scroller@citriik/vue-virtual-scroller@ceresimaging/rej@cling-se/v-tooltip-root-node@24consulting/audi_ui@aalves-test/shell@hokify/vue-virtual-scroller@davidarico/vue-virtual-scroller@deepdiver/vue-virtual-scroller@devstub/vue-virtual-scrollervue-virtual-scroller-enhancedvue-virtual-scroller-hivue-virtual-scroller-leahcimicvue-virtual-tablevue-virtual-table-variablevue-virtual-tablesvue-scroll-barvue-standardvue-virtual-scroll-patchvue-virtual-scroll-pluginvue-virtual-scrollervue-virtual-scroller-classicvue-virtual-scroller-czfixvue-virtual-scroller-devstubvue-virtualization-listvue-virtual-repeaterv-tooltip3zerionprokovanmailzktj-vue-virtual-scrollerzktj3-vue-virtual-scroller@guijs/frontend-ui@fork-anyone/vue-virtual-scroller@gidoont/v-tooltip@inconvo/vue-virtual-scroller@kurbar/vue-virtual-scroller@ishitatsuyuki/vue-virtual-scroller@mezereon/ui-components-vue@factoringplus/pl-components-pack@mikevmil/vue-googlemaps@impvis/components@ileostar/v3-directives@imkit/imkit-js-sdk-v3@duzhijie/vue-virtual-scroll-tree@kaidesuyo/vue-virtual-scroller@moonreach/ui@moonvy/floating-vue-2@rancher/dashboard-framework
1.0.1

4 years ago

2.0.0-alpha.1

4 years ago

1.0.0

4 years ago

0.5.0

5 years ago

0.4.5

6 years ago

0.4.4

7 years ago

0.4.3

7 years ago

0.4.2

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.0

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.4

7 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago