# vue-drag-split

> vue-drag-split 基于Vue的拖拽分屏组件

Latest version **0.0.5** (published 2023-03-23) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2023-03-23 |
| First published | 2022-12-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 180.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 18 |
| Author | rongang |
| Maintainers | rongang |
| Keywords | drag, split, 拖拽分屏 |

## Links

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

## Recent versions

- 0.0.5 (latest) — 2023-03-23
- 0.0.4 — 2023-03-23
- 0.0.3 — 2023-01-16
- 0.0.2 — 2022-12-20
- 0.0.1 — 2022-12-20
- 0.0.0 — 2022-12-20

## README

## VueDragSplit

```text
基于Vue的拖拽分屏组件
```

[点击查看例子](https://rongang.github.io/vue-drag-split/app/index.html)

![img](./public/demo.png)
## 开始

安装

```shell
yarn add vue-drag-split --save
```

使用

```vue
<template>
	<VueDragSplit
		:generateWindowConfig="generateWindowConfig"
		v-model:windowListSync="windowList"
		v-model:activeTabKeySync="activeTabKey"
		@closeWindow="onCloseWindow"
		@resize="onResize"
		@dragEnd="onDragend"
	>
		<template #Tab="win">
			<p style="color: white; font-size: 12px">{{ win.label }}</p>
		</template>
		<template #TabView="win">
			<div>
				<h3>自定义内容</h3>
				win:<br />
				{{ win }}<br />
			</div>
		</template>
	</VueDragSplit>
</template>

<script setup>
import {ref} from "@vue/reactivity";

// 引入样式文件
import "vue-drag-split/dist/style.css";
// 引入组件
import { VueDragSplit } from "vue-drag-split";

const activeTabKey = ref("");
const windowList = ref([
	{
		key: "1",
		label: "标签一",
	},
]);
function generateWindowConfig(params) {
	return {
		key: Date.now(),
		label: "标签" + Date.now(),
	};
}
function onCloseWindow(params) {
	console.log("onCloseWindow :>> ", params);
}
function onResize(params) {
	console.log("onResize :>> ", params);
}
function onDragend(params) {
	console.log("onDragend :>> ", params);
}
</script>
<script>
export default {};
</script>

<style></style>
```

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