# vue-view-split

> Resizable views (panels) for vue

Latest version **1.0.3** (published 2021-09-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-view-split
pnpm add vue-view-split
yarn add vue-view-split
bun add vue-view-split
```

## 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.3 |
| Published | 2021-09-20 |
| First published | 2021-09-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 26.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Demetrius Tuggle |
| Maintainers | tgnd |
| Keywords | split, split-layout, splitter, view-splitter, splitter, draggable, resizable, vue, vue-component |

## Links

- npm: https://www.npmjs.com/package/vue-view-split
- Repository: https://github.com/tuggle24/view-split
- Homepage: https://github.com/tuggle24/view-split#readme
- Issues: https://github.com/tuggle24/view-split/issues
- npm.io page: https://npm.io/package/vue-view-split

## Recent versions

- 1.0.3 (latest) — 2021-09-20
- 1.0.2 — 2021-09-20

## README

# vue-view-split

Create resizible views (panels) in Vue v2.

**Features:**

- Size is less than 2 kb
- Support both horizontal and vertical splits
- Support multiple splits
- Support lifecyle functions
- Support min and max sizes
- Support custom divider size
- Support for legacy browser such as IE 11

## Basic Example

In order for the below example to work correctly, the classname `view-split` needs to have `display: flex`.

```vue
<script>
import { ViewSplit } from "vue-view-split";

export default {
  components: {
    ViewSplit,
  },
  data() {
    return {
      options: { dividerSize: 17 },
    };
  },
};
</script>

<template>
  <ViewSplit :options="options">
    <div>s</div>
    <div>p</div>
    <div>l</div>
    <div>i</div>
    <div>t</div>
  </ViewSplit>
</template>

<style>
.view-split {
  display: flex;
}

.divider {
  background-color: rgb(156, 70, 255);
}
</style>
```

## API

```vue
<template>
  <ViewSplit :options="options">
    <div>s</div>
    <div>p</div>
  </ViewSplit>
</template>
```

**options**
Type: `object`

**divide**
Type: `string`
Default: `'vertical'`
Values: `'vertical' | 'horizontal'`

**sizes**
Type: `number | Array<number>`
Default: `new Array(children.length).fill(children.length / 2)`

**minSizes**
Type: `number | Array<number>`
Default: `new Array(children.length).fill(0)`

**maxSizes**
Type: `number | Array<number>`
Default: `new Array(children.length).fill(Number.POSITIVE_INFINITY)`

**onDrag**
Type: `Function(sizes)`

**beforeDrag**
Type: `Function(sizes)`

**afterDrag**
Type: `Function(sizes)`

## More Examples

**horizontal divide**

```vue
<script>
import { ViewSplit } from "vue-view-split";

export default {
  components: {
    ViewSplit,
  },
  data() {
    return {
      options: { dividerSize: 17, divide: "horizontal" },
    };
  },
};
</script>

<template>
  <ViewSplit :options="options">
    <div>s</div>
    <div>p</div>
    <div>l</div>
    <div>i</div>
    <div>t</div>
  </ViewSplit>
</template>

<style>
.view-split {
  display: flex;
  flex-direction: flex-direction;
}

.divider {
  background-color: rgb(156, 70, 255);
}
</style>
```

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