Package Exports
- vue-resize
- vue-resize/dist/vue-resize.css
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (vue-resize) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
vue-resize
Detect DOM element resizing
Installation
npm install --save vue-resizeUsage
import Vue from 'vue'
import VueResize from 'vue-resize'
Vue.use(VueResize)import Vue from 'vue'
import { ResizeObserver } from 'vue-resize'
Vue.component('resize-observer', ResizeObserver)import 'vue-resize/dist/test.css'
import VueResize from 'vue-resize/dist/test'
Vue.use(VueResize)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 () {
console.log('resized')
}
}
}
</script>
<style scoped>
.demo {
position: relative;
}
</style>