
์ธ์ด ๐ฐ๐ท ํ๊ตญ์ด
์์ํ๊ธฐ
์ฌ์ฉ๋ฒ
๋ฌธ์
FastComments Vue 2 Library
์ด๊ฒ์ FastComments์ ๊ณต์ Vue 2 ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ๋๋ค.
Vue 2์ฉ FastComments ๋๊ธ ์์ ฏ
์ ์ฅ์
์ฌ์ฉ๋ฒ 
๋๊ธ ์์ ฏ
FastCommentsVue ์ปดํฌ๋ํธ์๋ ๋ผ์ด๋ธ FastComments ๋๊ธ ์์ ฏ์ด ํฌํจ๋์ด ์์ต๋๋ค.
์๋์ "demo"๋ฅผ ๊ทํ์ "tenantId"๋ก ๋ฐ๊พธ์ธ์ - FastComments ๊ด๋ฆฌ์ ์์ญ์ here์์ ํ์ธํ ์ ์์ต๋๋ค.
์ด ์์ ฏ์ ๋ง์ ์ต์ ์ ์ง์ํฉ๋๋ค - FastCommentsConfig๋ here์์ ํ์ธํ์ธ์.
<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 ๊ฐ์ฒด์ ๋ณํ๋ฅผ ๊ฐ์ํ์ฌ ๋ฆฌ๋ก๋ํ๋ฏ๋ก, "url"๊ณผ "urlId" ์ค์ ๋ง ์ ๋ฐ์ดํธํ๋ฉด ๋ฉ๋๋ค.
์ ์ฒด ์๋ ์์ ๋ ์ฌ๊ธฐ์์ ํ์ธํ์ธ์.
ํ์ด์ง๋ค์ด์ ์์ ๋ฅผ ๋ค์ ๋ช ๋ น์ผ๋ก ์คํํ์ธ์:
npm run serve-pagination<fast-comments-vue v-bind:config="{tenantId: 'demo', url: 'https://example.com', urlId: 'some-page-id'}" />
๊ณ์ ์ง์ญ (์ฃผ์: EU ๊ณ ๊ฐ)
๊ณ์ ์ด EU์ ์๋ ๊ฒฝ์ฐ ์์ ฏ ๊ตฌ์ฑ์์ region = 'eu'๋ก ์ค์ ํ์ธ์. ์๋ฅผ ๋ค๋ฉด:
<fast-comments-vue v-bind:config="{tenantId: 'demo', url: 'https://example.com', urlId: 'some-page-id', region: 'eu'}" />
๊ทธ๋ ์ง ์์ผ๋ฉด region์ ์ ์ํ ํ์๊ฐ ์์ต๋๋ค.
์ด์ ํ๊ฒฝ์์ 
์๋ง ์ฝ๋ฐฑ ๋ฑ์ ์ ๋ฌํ๋ ๊ฒฝ์ฐ config์ ์ธ๋ผ์ธ์ผ๋ก ์ ์ํ์ง ์๋ ๊ฒ์ด ์ข์ต๋๋ค. ๋์ , ๋น์ ์
config์ computed ๋ธ๋ก์ ์ ์ํ๋ ํธ์ด ์ข์ต๋๋ค. ๊ทธ๋ ์ง ์์ผ๋ฉด ์ฝ๋ฐฑ ๋ฑ์ด ํธ์ถ๋ ๋๋ง๋ค ์์ ฏ ์ ์ฒด๊ฐ ๋ค์ ๋ ๋๋ง๋ฉ๋๋ค.
์คํผ๋ ์์ ๊ฐ ์ด๋ฅผ ์ํํ๋ ๋ฐฉ๋ฒ์ ์ฐธ์กฐํ์ธ์.
๋์์ด ํ์ํ์ ๊ฐ์?
Vue 2 ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ๊ด๋ จํ์ฌ ๋ฌธ์ ๊ฐ ๋ฐ์ํ๊ฑฐ๋ ์ง๋ฌธ์ด ์์ผ์๋ฉด, ๋ค์์ ์ด์ฉํด ์ฃผ์ธ์:
๊ธฐ์ฌํ๊ธฐ
๊ธฐ์ฌ๋ฅผ ํ์ํฉ๋๋ค! ๊ธฐ์ฌ ์ง์นจ์ GitHub ์ ์ฅ์๋ฅผ ๋ฐฉ๋ฌธํด ์ฃผ์ธ์.