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

lzy-slide-unlock

v1.0.0

Published

A Vue 3 slide-to-unlock component with configurable text, size and colors.

Readme

lzy-slide-unlock

适配 Vue 3 的滑动滑块解锁组件。组件可直接放进 <template> 中使用,支持外部动态设置背景色、宽高、文本等样式参数。

安装

npm install lzy-slide-unlock

使用

<template>
  <SlideUnlock text="滑动完成取货" width="100vw" height="50px" bgColor="#342234" />
</template>

<script setup>
import SlideUnlock from "lzy-slide-unlock";
</script>

动态设置:

<template>
  <SlideUnlock
    :text="unlockText"
    :width="width"
    :height="height"
    :bgColor="bgColor"
    :resetOnSuccess="true"
    @success="handleSuccess"
  />
</template>

<script setup>
import { ref } from "vue";
import SlideUnlock from "lzy-slide-unlock";

const unlockText = ref("滑动完成取货");
const width = ref("100vw");
const height = ref("50px");
const bgColor = ref("#342234");

function handleSuccess() {
  console.log("解锁成功");
}
</script>

Props

| 参数 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | | text | string | 滑动完成取货 | 中间显示文本 | | width | number \| string | 680px | 组件宽度,数字会自动转为 px | | height | number \| string | 80px | 组件高度,数字会自动转为 px | | bgColor | string | #2f9d32 | 背景色 | | maskColor | string | rgb(222 235 230 / 0.62) | 拖动时左侧遮罩色 | | textColor | string | #ffffff | 文本颜色 | | textSize | number \| string | 28px | 文本字号 | | handleColor | string | #ffffff | 滑块颜色 | | arrowColor | string | #279b35 | 箭头颜色 | | disabled | boolean | false | 是否禁用 | | successThreshold | number | 0.96 | 完成阈值,范围 0-1 | | resetOnSuccess | boolean | true | 滑动成功后是否自动回到初始状态 |

Events

| 事件 | 说明 | | --- | --- | | change | 拖动时触发,返回当前进度 0-1 | | success | 滑动到阈值后触发,是否回到初始状态由 resetOnSuccess 控制 | | reset | 调用组件实例 reset() 后触发 |

实例方法

<template>
  <SlideUnlock ref="unlockRef" text="滑动完成取货" />
  <button @click="unlockRef?.reset()">重置</button>
</template>

<script setup>
import { ref } from "vue";
import SlideUnlock from "lzy-slide-unlock";

const unlockRef = ref();
</script>
  • reset():重置到初始位置。
  • complete():手动置为完成状态。
  • getPercent():获取当前滑动进度。