npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

divider-vue3

v1.0.6

Published

A flexible Vue 3 draggable divider component for resizable panels

Downloads

618

Readme

Divider - Vue3 拖拽分割组件

一个极简灵活的可拖拽分割组件,用于调整容器的尺寸(开箱即用)

  • 支持对容器进行水平或垂直分割
  • 支持限定容器最小宽高
  • 支持样式的自定义

演示

演示视频

快速开始

npm i divider-vue3
<template>
  <div class="container">
    <div class="left">左侧</div>
    <Divider direction="x"/>
    <div class="right">右侧</div>
  </div>
</template>

<script setup lang="ts">
import { Divider } from 'divider-vue3'
</script>

<style scoped>
.container {
  width: 100vw;
  height: 100vh;
  display: flex;
  padding: 1rem;
  background-color: rgb(220, 220, 220);
}

.left {
  background-color: white;
  flex: 1;
}

.right {
  background-color: white;
  flex: 1;
}
</style>

完整用法

<template>
  <div class="container">
    <div class="left">左侧</div>
    <Divider direction="x" :minSize="10" :style="dividerStyle" @resizeEnd="handleResizeEnd" />
    <div class="right">
      <div class="top">上侧</div>
      <Divider direction="y" :minSize="10" :style="dividerStyle" @resizeEnd="handleResizeEnd" />
      <div class="bottom">下侧</div>
    </div>
  </div>
</template>

<script setup>
import Divider from './components/Dvider.vue'

// 自定义样式配置
const dividerStyle = {
  color: 'rgb(170,173,180)',
  highlightColor: '#60a5fa',
  containerWidth: 0.625,
  lineWidth: 0.125,
  hoverLineWidth: 0.2
}

const handleResizeEnd = (event) => {
  console.log('Resize event:', event)
}
</script>

<style scoped>
.container {
  width: 100vw;
  height: 100vh;
  display: flex;
  padding: 1rem;
  background-color: rgb(220, 220, 220);
}

.left {
  background-color: white;
  flex: 1;
}

.right {
  flex: 1;
  display: flex;
  flex-direction: column;

  .top {
    flex: 1;
    background-color: white;
  }

  .bottom {
    flex: 1;
    background-color: white;
  }
}
</style>

Props

| 属性 | 类型 | 默认值 | 说明 | |------|------|--------|------| | direction | 'x' \| 'y' | 'x' | 分割方向(x 水平,y 垂直) | | minSize | number | 10 | 最小尺寸(rem) | | style | object | {} | 样式配置 |

样式配置

{
  color: '#9ca3af',           // 分割线颜色
  highlightColor: '#4ade80',  // 悬浮时颜色
  containerWidth: 0.625,      // 容器宽度 (rem)
  lineWidth: 0.125,           // 分割线宽度 (rem)
  hoverLineWidth: 0.2         // 悬浮时宽度 (rem)
}

事件

| 事件 | 说明 | |------|------| | resizeEnd | 拖拽结束时触发 |

许可证

MIT