# lc-vue-auto-height-wrapper

> ResizeObserver封装

Latest version **1.1.14** (published 2023-05-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install lc-vue-auto-height-wrapper
pnpm add lc-vue-auto-height-wrapper
yarn add lc-vue-auto-height-wrapper
bun add lc-vue-auto-height-wrapper
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.14 |
| Published | 2023-05-05 |
| First published | 2023-03-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.7 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | lvliqi |
| Maintainers | lvliqi |
| Keywords | ElementSize, vue, vue3, ResizeObserver, resize, observer |

## Links

- npm: https://www.npmjs.com/package/lc-vue-auto-height-wrapper
- Repository: https://github.com/dreamllq/vue-auto-height-wrapper
- Homepage: https://github.com/dreamllq/vue-auto-height-wrapper#readme
- Issues: https://github.com/dreamllq/vue-auto-height-wrapper/issues
- npm.io page: https://npm.io/package/lc-vue-auto-height-wrapper

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 1.1.14 (latest) — 2023-05-05
- 1.1.13 — 2023-05-02
- 1.1.11 — 2023-05-02
- 1.1.9 — 2023-05-02
- 1.1.8 — 2023-05-02
- 1.1.7 — 2023-05-02
- 1.1.6 — 2023-05-02
- 1.1.5 — 2023-05-02
- 1.1.4 — 2023-04-29
- 1.1.3 — 2023-04-29
- 1.1.2 — 2023-04-29
- 1.1.1 — 2023-04-29
- 1.1.0 — 2023-04-29
- 1.0.3 — 2023-03-12
- 1.0.2 — 2023-03-07
- … 1 more at https://npm.io/package/lc-vue-auto-height-wrapper/versions

## README

# lc-vue-auto-height-wrapper

ResizeObserver封装， 能够方便的在template中获取父容器的尺寸

常用场景：

- 配合 element-plus 中的 table 组件实现动态容器固定表头

## Demo

[demo](https://unpkg.com/lc-vue-auto-height-wrapper/docs/.vitepress/dist/index.html) 

## 安装 

```
npm i lc-vue-auto-height-wrapper 
```

## 例子

```vue
<script setup lang="ts">
  import { ref, computed } from 'vue';
  import { AutoHeightWrapper } from 'lc-vue-auto-height-wrapper';
  const width = ref(100);
  const height = ref(100);
  const style = computed(()=>({
    width: `${width.value}px`,
    height: `${height.value}px`
  }))
</script>

<template>
  <el-slider v-model="width" :min='100' :max='500' />
  <el-slider v-model="height" :min='100' :max='500' />
  <div style='border: 1px solid #000; display: inline-block'>
    <div :style='style'>
      <AutoHeightWrapper>
        <template #default="{size}">
          {{size}}
        </template>
      </AutoHeightWrapper>  
    </div>
  </div>
</template>
```

## API

### Slots

| 插槽名 | 说明 | 参数 |
| ---- | ---- | ---- | 
| default | 自定义内容 | size: \{ width: number, height: number \} |

---
_Source: https://npm.io/package/lc-vue-auto-height-wrapper · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
