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 🙏

© 2026 – Pkg Stats / Ryan Hefner

resizable-view

v0.2.4

Published

借助组件可以实现拖动滑动条改变布局大小,目前实现了横向、纵向效果,支持嵌套使用。

Readme

ResizableView

功能说明

借助组件可以实现拖动滑动条改变布局大小,目前实现了横向、纵向效果,支持嵌套使用。

演示效果:

安装与使用

  • 安装

npm install resizable-view
  • 引入项目

import {createApp} from 'vue'
import App from './App.vue'
// 引入组件和样式表
import ResizableView from 'resizable-view'
import 'resizable-view/dist/resizable-view.css'

const app = createApp(App)
// 注册到Vue
app.use(ResizableView)

app.mount('#app')
  • 水平布局

<template>
  <div id="app">
    <resizable-view>
      <resizable-item style="background-color:bisque;" base-width="30%"></resizable-item>
      <resizable-item style="background-color:blanchedalmond;" base-width="70%"></resizable-item>
    </resizable-view>
  </div>
</template>

<script>

export default {
  name: "App"
};
</script>

<style>
body {
  margin: 0;
  padding: 0;
}

#app {
  width: 100%;
  height: 100vh;
}
</style>

示例效果:

  • 垂直布局

这里用到了ResizableView组件的mode属性来控制布局方向

<template>
  <div id="app">
    <resizable-view mode="vertical">
      <resizable-item style="background-color:bisque;" base-height="30%"></resizable-item>
      <resizable-item style="background-color:blanchedalmond;" base-height="70%"></resizable-item>
    </resizable-view>
  </div>
</template>

示例效果:

  • 嵌套使用

<template>
  <div id="app">
    <resizable-view>
      <resizable-item style="background-color:bisque;" base-width="30%"></resizable-item>
      <resizable-item style="background-color:blanchedalmond;" base-width="70%">
        <resizable-view mode="vertical">
        <resizable-item style="background-color:burlywood;" base-height="50%">
          <resizable-view>
            <resizable-item style="background-color:blueviolet;" :min-width="200"></resizable-item>
            <resizable-item style="background-color:cornflowerblue" sliderBar="right"></resizable-item>
          </resizable-view>
        </resizable-item>
        <resizable-item style="background-color:chocolate;" base-height="30%"></resizable-item>
        <resizable-item style="background-color:coral;" base-height="20%"></resizable-item>
      </resizable-view>
      </resizable-item>
    </resizable-view>
  </div>
</template>

示例效果:

属性说明

  • ResizableView 组件

    属性

    | 名称 | 描述 |
    | ---- | ---- | | mode | 控制ResizableView组件包含的ResizableItem分布方向,String类型,默认值: horizontal,可选值:horizontalvertical|

    事件

    | 名称 | 描述 |
    | ---- | ---- | | itemresize | 当选中的ResizableItem改变大小时触发,事件可接收以下参数 clientWidthclientHeighttarget, 其中target是当前ResizableItem对象,clientWidthclientHeight则是target对象的宽、高|

  • ResizableItem 组件

    | 属性 | 描述 |
    | ---- | ---- | | minWidth | ResizableItem的最小宽度,Number类型,默认值:0 |
    | minHeight | ResizableItem的最小高度,Number类型,默认值:0 |
    | base*SliderSize | ResizableItem滑条的大小,Number类型,默认值:5,* 可选值:TopRightBottomLeft |
    | sliderBar | ResizableItem要显示的滑条列表,String、Array类型,默认值:right,可选值:["none", "all", "top", "right", "bottom", "left"] |