본문으로 건너뛰기
Skillpedia
웹사이트 및 UI (프런트엔드)29k · #9843

table-state

하는 일

이 스킬은 현재 페이지 같은 테이블 설정을 Vue ref에 보관하고 템플릿에서 읽는 방법을 설명합니다. 테이블과 페이지가 함께 맞아야 하는 Vue 개발자를 위한 것입니다.

사용하는 경우

  • ✓Vue 템플릿이 현재 페이지나 다른 테이블 설정을 보여줘야 할 때.
  • ✓테이블의 페이지네이션을 ref나 computed 값에 연결해야 할 때.
  • ✓일반 스크립트 코드에서 한 번 읽은 테이블 값이 변경 후 갱신되지 않을 때.

스킬 링크

https://github.com/TanStack/table/blob/main/packages/vue-table/skills/table-state/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/TanStack/table/blob/main/packages/vue-table/skills/table-state/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“다음 버튼을 누르면 Vue 테이블의 페이지 번호가 화면에서 바뀌도록 하려면 어떻게 하나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

페이지네이션 설정을 ref에 보관하고, 맞는 업데이트 콜백과 함께 computed 상태로 테이블에 전달한 뒤 템플릿에서 읽는 방법을 보여줍니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Vue table state

Before starting, run intent load @tanstack/table-core#table-state for shared ownership, initialization, updates, and resets.

Read reactive state

Vue-backed atom reads track dependencies inside templates, computed, watch, or a render boundary. const page = table.atoms.pagination.get() outside tracking captures a snapshot. Keep reactive option inputs as refs, computed values, or getters; passing .value once breaks later synchronization.

table.Subscribe is deprecated. Read table APIs or atoms directly inside templates, render functions, computed getters, or watcher sources. Use a child component when reads need a separate component render boundary.

Control a slice

Keep features and columns stable. Preserve both the reactive value and its matching callback:

import { computed, ref } from 'vue'
import {
  rowPaginationFeature,
  tableFeatures,
  useTable,
  type PaginationState,
  type Updater,
} from '@tanstack/vue-table'

const features = tableFeatures({ rowPaginationFeature })
const columns = [{ accessorKey: 'name' }]
const data = ref([{ name: 'Ada' }])
const pagination = ref<PaginationState>({ pageIndex: 0, pageSize: 20 })
const state = computed(() => ({ pagination: pagination.value }))
const table = useTable({
  features,
  columns,
  data,
  state,
  onPaginationChange: (next: Updater<PaginationState>) => {
    pagination.value =
      typeof next === 'function' ? next(pagination.value) : next
  },
})
const pageSize = computed(() => table.atoms.pagination.get().pageSize)

Assign the resolved updater result to the ref. For shared atom ownership, use a stable @tanstack/vue-store atom in atoms.<slice> instead of mirroring the same slice in controlled refs.

For computed-state synchronization failures, updater mistakes, or render boundaries, read reactivity details. If this task changes processing features, run intent load @tanstack/table-core#table-features and read the relevant feature references.

API discovery

Inspect node_modules/@tanstack/vue-table/dist/useTable.d.ts and reactivity.d.ts; inspect the matching core feature declarations for the controlled slice.

자주 묻는 질문

스크립트에서 한 번 읽은 값이 왜 갱신되지 않나요?

추적되지 않는 상황의 읽기는 스냅샷을 만들며, 그 스냅샷은 나중에 갱신되지 않습니다.

테이블에 .value를 넘겨야 하나요?

아닙니다. .value를 한 번 넘기면 이후 동기화가 깨지므로, 반응형 입력은 ref, computed 값, getter로 유지하라고 설명합니다.

table.Subscribe를 아직 쓰나요?

지원 중단되었습니다. 이 스킬은 템플릿에서 테이블 API나 atom을 직접 읽으라고 권장합니다.

상세 정보

작성자의 원본 설명

Read and control Table v9 state in vue. Use for tracked reads, subscriptions, controlled slices, and framework-specific reactive boundaries.

repo: TanStack/table

인기도

GitHub 스타
29k
순위
#9843
라이선스
MIT
업데이트
2026. 10. 21.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬