透過超過 100 個技巧的集合來學習 Nuxt!

disqus
nuxt-disqus

Nuxt 的 Disqus 評論模組 - 立即將評論小工具添加到您的應用程式

適用於 Nuxt 3 的 Disqus

npm versionnpm downloadsLicenseNuxt

使用此專為 Nuxt 3 設計的套件,立即將 Disqus 評論添加到您的文章或頁面。

Nuxt Disqus 提供 vue3-disqus 的包裝器,以便在 Nuxt 3 中使用

特色

  • 🔆易於整合
  • ⚡️可立即使用的元件 DisqusCommentsDisqusCount

快速設定

  1. nuxt-disqus 相依性新增至您的專案
    npx nuxi@latest module add disqus
    
  2. nuxt-disqus 新增至 nuxt.config.tsmodules 區段
    export default defineNuxtConfig({
      modules: ["nuxt-disqus"],
      disqus: {
        shortname: "your-disqus-shortname",
      },
    });
    
  3. DisqusComments 放置在應用程式中的任何位置,以便為特定的 identifier 呈現 Disqus 評論串
    <DisqusComments identifier="/blog/1" />
    
  4. DisqusCount 放置在應用程式中的任何位置,以便為特定的 identifier 呈現 Disqus 評論計數
    <DisqusCount identifier="/blog/1" />
    

    DisqusCount 的範例輸出將為
    99 Comments
    

就是這樣!您現在可以在 Nuxt 應用程式中使用 Disqus 了✨

開發

# Install dependencies
yarn install

# Generate type stubs
yarn run dev:prepare

# Develop with the playground
yarn run dev

# Build the playground
yarn run dev:build

# Run ESLint
yarn run lint

# Run Vitest
yarn run test
yarn run test:watch

# Release new version
yarn run release