
語言 🇹🇼 繁體中文
文件
快速入門
使用
Add Comments to Your Vue 2 App
這是 FastComments 的官方 Vue 2 函式庫。
適用於 Vue 2 的 FastComments 評論元件
儲存庫
即時示範 
要在本機針對公開的 demo 租戶查看所有小工具與流程的運行,請複製儲存庫並執行:
npm install
npm run serve
各個示例在 dev/ 底下也有各自的入口點(npm run serve-collab-chat, serve-live-chat, serve-image-chat, serve-pagination, serve-toggle-dark-mode)。
使用 
評論小工具
FastCommentsVue component 包含即時的 FastComments 評論小工具。
請將下方的 "demo" 替換為您的 "tenantId" - 可在 FastComments 管理區的 這裡 取得。
此小工具支援許多選項 - 請在 這裡 查看 FastCommentsConfig。
<script lang="ts">
import Vue from 'vue';
import FastCommentsVue from 'fastcomments-vue';
export default Vue.extend({
name: 'ServeDev',
components: {
FastCommentsVue
}
});
</script>
<template>
<div id="app">
<fast-comments-vue v-bind:config="{tenantId: 'demo'}" />
</div>
</template>
更新當前頁面(SPA 範例) 
在 FastComments 中,我們將文章 id(或留言所綁定的頁面)稱為 URL ID,因為它可以是 url 或一個 ID。 請以下列方式定義 URL ID。元件會監聽 config object 的變更並重新載入,因此你只需更新 "url" 和 "urlId" 設定即可。
完整的運作範例請見 這裡。
透過以下指令執行分頁範例:
npm run serve-pagination<fast-comments-vue v-bind:config="{tenantId: 'demo', url: 'https://example.com', urlId: 'some-page-id'}" />
帳戶區域(注意:歐盟客戶)
如果你的帳戶位於歐盟,請在 widget 設定中將 region = 'eu',例如:
<fast-comments-vue v-bind:config="{tenantId: 'demo', url: 'https://example.com', urlId: 'some-page-id', region: 'eu'}" />
否則,你不必定義 region。
在生產環境中 
你大概不想在行內定義 config,如果你要傳遞 callbacks 等。相反,你會想要定義
config 在一個 computed 區塊中,否則每次你的 callback 等被呼叫時,整個 widget 都會重新渲染。
維護狀態 
這些元件是我們核心 VanillaJS 元件的包裝層。我們可以自動更新這些元件(修復錯誤、加入功能)而無需發布這個函式庫,因此即便它可能有一段時間不會發布,也不代表 FastComments 未在積極開發中!歡迎查看 我們的部落格 以獲得更新。重大破壞性 API 變更或功能不會在不提高此函式庫版本的情況下被推送到底層核心函式庫。
需要幫助?
如果您在使用 Vue 2 函式庫時遇到任何問題或有疑問,請:
貢獻
歡迎貢獻!請造訪 GitHub 儲存庫 以查看貢獻指南。