# @king0725/resize

> 支持多列拖拉指令。

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

## Install

```sh
npm install @king0725/resize
pnpm add @king0725/resize
yarn add @king0725/resize
bun add @king0725/resize
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2023-12-05 |
| First published | 2023-12-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | king0725 |
| Maintainers | king0725 |
| Keywords | v-resize |

## Links

- npm: https://www.npmjs.com/package/@king0725/resize
- Repository: https://gitee.com/wupeng0725/v-resize
- Issues: https://gitee.com/wupeng0725/v-resize/issues
- npm.io page: https://npm.io/package/@king0725/resize

## 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.0.2 (latest) — 2023-12-05
- 1.0.1 — 2023-12-04
- 1.0.0 — 2023-12-04
- 0.0.1 — 2023-12-04

## README

# Resize

![Version](https://img.shields.io/npm/v/@king0725/resize)

## 支持多列拖拉指令。

## 环境：vue3+ts

## 使用
安装`npm i @king0725/resize`

在`main.ts`中引入：
```ts
import vResize from '@king0725/resize'

...
app.use(vResize)
...
```

## 参数：
1. min为最小宽度/高度
2. hoverColor悬浮颜色
3. lineColor线的颜色，用于复选后恢复线的初始颜色
4. showHoverColor是否鼠标光标悬浮就展示颜色，默认拖拽过程中才改变颜色
5. direction 拖拽的方向，horizontal/vertical，默认值horizontal水平

## 示例：

### 示例1：水平方向（默认）

![image-20231204165140905](https://gitee.com/wupeng0725/v-resize/raw/master/src/assets/image-20231204165140905.png)

代码如下：

```ts
<template>
  <div class="resize-box">
    <div class="resize-left"></div>
    <div class="resize-line"
      v-resize="{ min: 20, hoverColor: '#88f', lineColor: '#ccc', showHoverColor: false, direction: 'horizontal' }">
    </div>
    <div class="resize-middle"></div>
    <div class="resize-line" v-resize>
    </div>
    <div class="resize-right"></div>
  </div>
</template>

<script setup lang="ts">
</script>

<style scoped>
.resize-box {
  display: flex;
  height: 300px;
  width: 100%;
}

.resize-left {
  background-color: skyblue;
  width: calc(40% - 5px);
}

.resize-line {
  width: 5px;
  background-color: #ccc;
  cursor: col-resize;
}

.resize-middle {
  background-color: pink;
  width: calc(30% - 5px);
}

.resize-right {
  background-color: cadetblue;
  width: 30%;
}
</style>
```

### 示例2：垂直方向：

![image-20231204165156876](https://gitee.com/wupeng0725/v-resize/raw/master/src/assets/image-20231204165156876.png)

代码如下：

```ts
<template>
  <div class="resize-box-vertical">
    <div class="resize-left-vertical"></div>
    <div class="resize-line-vertical"
      v-resize="{ min: 20, hoverColor: '#88f', lineColor: '#ccc', showHoverColor: false, direction: 'vertical' }">
    </div>
    <div class="resize-middle-vertical"></div>
    <div class="resize-line-vertical" v-resize="{ direction: 'vertical' }">
    </div>
    <div class="resize-right-vertical"></div>
  </div>
</template>

<script setup lang="ts">
</script>

<style scoped>
.resize-box-vertical {
  height: 500px;
}

.resize-left-vertical {
  background-color: skyblue;
  height: calc(40% - 5px);
}

.resize-middle-vertical {
  background-color: pink;
  height: calc(30% - 5px);
}

.resize-line-vertical {
  height: 5px;
  background-color: #ccc;
  cursor: row-resize;
}

.resize-right-vertical {
  background-color: cadetblue;
  height: 30%;
}
</style>
```

---
_Source: https://npm.io/package/@king0725/resize · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
