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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@king0725/resize

v1.0.2

Published

支持多列拖拉指令。

Downloads

6

Readme

Resize

Version

支持多列拖拉指令。

环境:vue3+ts

使用

安装npm i @king0725/resize

main.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

代码如下:

<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

代码如下:

<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>