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

vue-enhanced-swiper

v1.0.4

Published

Enhanced mobile swiper component for Vue 3 with scroll conflict resolution

Readme

Vue Enhanced Swiper

🚀 增强版 Vue 3 移动端轮播组件,解决嵌套滚动冲突问题

npm version TypeScript Vue 3 License: MIT

✨ 特性

  • 🎯 智能冲突解决 - 自动识别内部滚动与轮播切换的手势冲突
  • 🔧 高度可配置 - 灵活的配置选项满足各种使用场景
  • 🚀 性能优化 - 内置缓存、节流、Web Worker 等性能优化
  • 📱 移动端优先 - 专为移动端触摸交互设计
  • 🎨 TypeScript 支持 - 完整的类型定义和智能提示
  • 🌟 Vue 3 原生 - 基于 Composition API,完美集成 Vue 3 生态

📦 安装

npm install vue-enhanced-swiper swiper
# 或
yarn add vue-enhanced-swiper swiper  
# 或
pnpm add vue-enhanced-swiper swiper

🚀 快速开始

基础用法

<template>
  <VueEnhancedSwiper
    :direction="'vertical'"
    :scroll-conflict="{
      enabled: true,
      tolerance: 5,
      debug: false
    }"
    @slide-change="onSlideChange"
  >
    <SwiperSlide v-for="(item, index) in slides" :key="index">
      <div class="slide-content">
        <h2>{{ item.title }}</h2>
        <div class="scrollable-content">
          <p v-for="paragraph in item.content" :key="paragraph">
            {{ paragraph }}
          </p>
        </div>
      </div>
    </SwiperSlide>
  </VueEnhancedSwiper>
</template>

<script setup lang="ts">
import { VueEnhancedSwiper, SwiperSlide } from 'vue-enhanced-swiper'
import 'vue-enhanced-swiper/style.css'

const slides = [
  {
    title: '第一页',
    content: ['这是一个可以滚动的内容区域...', '更多内容...']
  },
  // 更多幻灯片...
]

function onSlideChange(swiper) {
  console.log('当前页:', swiper.activeIndex)
}
</script>

🔧 配置选项

ScrollConflict 配置

| 属性 | 类型 | 默认值 | 描述 | |------|------|--------|------| | enabled | boolean | true | 是否启用冲突解决 | | tolerance | number | 5 | 边界检测容忍度(px) | | debug | boolean | false | 启用调试模式 | | swipeDistance.withScroll | number | 50 | 有滚动元素时的滑动距离阈值(px) | | swipeDistance.withoutScroll | number | 30 | 无滚动元素时的滑动距离阈值(px) |

高级配置示例

<VueEnhancedSwiper
  :direction="'vertical'"
  :scroll-conflict="{
    enabled: true,
    tolerance: 5,
    debug: true,
    swipeDistance: {
      withScroll: 80,    // 有滚动内容时需要80px滑动距离
      withoutScroll: 40  // 无滚动内容时需要40px滑动距离
    }
  }"
  @slide-change="onSlideChange"
  @scroll-conflict="onScrollConflict"
>
  <!-- 内容 -->
</VueEnhancedSwiper>

🎯 使用场景

  • 新闻应用 - 垂直翻页 + 文章内容滚动
  • 产品展示 - 水平轮播 + 详情页面滚动
  • 社交应用 - 动态翻页 + 评论区滚动
  • 电商应用 - 商品轮播 + 规格描述滚动

🤝 贡献

欢迎贡献代码!请阅读 贡献指南 了解详细信息。

开发环境设置

# 克隆仓库
git clone https://github.com/your-username/vue-enhanced-swiper.git

# 安装依赖
npm install

# 启动开发服务器
npm run dev

# 运行测试
npm run test

# 构建项目
npm run build

📄 许可证

MIT License


如果这个项目对您有帮助,请考虑给它一个 ⭐️ 星标!