通过 100+ 个技巧学习 Nuxt!

locomotive-scroll
nuxt-locomotive-scroll

一个 Nuxt 模块,可以轻松地将 Locomotive Scroll 集成到你的 Nuxt 应用程序中。

感谢 starter-kit-nuxt-locomotive-scroll nuxt v2 by DidoMarchet

Nuxt Locomotive Scroll

一个 Nuxt 模块,可以轻松地将 Locomotive Scroll 集成到你的 Nuxt 应用程序中。

npm versionnpm downloadsLicenseNuxt

功能特性

  • 🚀  易于使用
  • 🎨  可自定义

快速设置

使用一个命令将模块安装到你的 Nuxt 应用程序中

npx nuxi module add locomotive-scroll

就是这样! 你现在可以在你的 Nuxt 应用程序中使用 Nuxt Locomotive Scroll ✨,或者你可以手动安装它

# npm
npm install nuxt-locomotive-scroll

# yarn
yarn add nuxt-locomotive-scroll

# pnpm
pnpm add nuxt-locomotive-scroll

并将 nuxt-locomotive-scroll 添加到 modules 部分 of nuxt.config

export default defineNuxtConfig({
  modules: [
    'nuxt-locomotive-scroll',
  ],
})

用法

只需将 v-locomotive 指令添加到你想要动画的元素上。

<template>
  <div v-locomotive>
    <!-- Your content here -->
  </div>
</template>

你可以查看 playground 以获取更多示例。

贡献

本地开发
# Install dependencies
npm install

# Generate type stubs
npm run dev:prepare

# Develop with the playground
npm run dev

# Build the playground
npm run dev:build

# Run ESLint
npm run lint

# Run Vitest
npm run test
npm run test:watch

# Release new version
npm run release