@zhibi/vue-auto-sizer

1.0.0 • Public • Published

vue-auto-sizer

A Vue component that automatically adjusts the width and height of its children to fill the available space.Clone of react-virtualized-auto-sizer.

一个自动调整其子组件的宽度和高度以填充可用空间的Vue组件。react-virtualized-auto-sizer的复制版。

Install

npm install --save vue-auto-sizer

Usage

<template>
  <div>
    <vue-auto-sizer>
      <template slot-scope="{ width, height }">
        <div :style="{ width: width + 'px', height: height + 'px' }">
          <div>Width: {{ width }}</div>
          <div>Height: {{ height }}</div>
        </div>
      </template>
    </vue-auto-sizer>
  </div>
</template>

<script>
  import VueAutoSizer from 'vue-auto-sizer'
  export default {
    components: {
      VueAutoSizer
    }
  }
</script>

Documentation

Please see API documentation of "AutoSizer" in react-virtualized package here.

License

MIT © bvaughn

Package Sidebar

Install

npm i @zhibi/vue-auto-sizer

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

19.6 kB

Total Files

5

Last publish

Collaborators

  • zhibi