透過 100+ 個技巧學習 Nuxt!

locomotive-scroll
nuxt-locomotive-scroll

一個 Nuxt 模組,可輕鬆將 Locomotive Scroll 整合到您的 Nuxt 應用程式中。

感謝 starter-kit-nuxt-locomotive-scroll nuxt v2,作者為 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 新增到 nuxt.configmodules 區段中。

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

使用方式

只需將 v-locomotive 指令新增到您想要動畫化的元素。

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

您可以查看遊樂場以獲得更多範例。

貢獻

本地開發
# 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