devtools
它能做什么
这项技能展示如何把 Vue 表格注册到 TanStack Devtools 面板中,使开发者在构建时能检查它们。内容涵盖设置、必需的键,以及表格被替换时的清理。
适用场景
- ✓当 Vue 表格没有出现在开发者工具面板中,你需要修复其注册的时候。
- ✓当 Vue 组件中的表格被替换,开发者工具必须跟随新表格的时候。
- ✓当你希望开发者工具只出现在开发构建中的时候。
技能链接
https://github.com/TanStack/table/blob/main/packages/vue-table-devtools/skills/devtools/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“为什么我的 Vue 表格没有列在 TanStack 开发者工具面板中?”
每周 5 个新技能,1 分钟读完。
工作原理
它解释如何用唯一的键创建表格,在组件中调用注册钩子,并在应用根部附近添加一个开发者工具宿主。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
This skill builds on @tanstack/table-core#core and @tanstack/table-devtools#devtools.
Setup
<script setup lang="ts">
import { useTable, tableFeatures } from '@tanstack/vue-table'
import { useTanStackTableDevtools } from '@tanstack/vue-table-devtools'
const table = useTable({
key: 'users-table',
features: tableFeatures({}),
columns: [],
data: [],
})
useTanStackTableDevtools(table)
</script>
<template><div>Users table registered</div></template>
Mount the Vue TanStackDevtools host once with tableDevtoolsPlugin({}), following docs/devtools.md.
Hooks and Components
The hook accepts a table or ref-like table and tracks replacement. Keep that reactive wrapper intact rather than unwrapping once.
Common Mistakes
HIGH Ref unwrapped before registration
Wrong: read a ref once and register only that snapshot.
Correct: pass the ref/maybe-ref shape accepted by the hook.
The adapter watches the resolved table and cleans up when it changes.
Source: TanStack/table:packages/vue-table-devtools/src/useTanStackTableDevtools.ts
HIGH Missing or duplicate key
Wrong: omit key or reuse a key across mounted tables.
Correct: use one descriptive stable key for each target.
The registry skips keyless tables and replaces duplicate targets.
Source: TanStack/table:packages/table-devtools/src/tableTarget.ts
MEDIUM Development gate mistaken for broken plugin
Wrong: expect the default panel/plugin/hook in production.
Correct: keep normal Devtools development-only unless explicitly importing /production.
The package index selects no-op exports outside development.
Source: TanStack/table:packages/vue-table-devtools/src/index.ts
API Discovery
Inspect node_modules/@tanstack/vue-table-devtools/dist/index.d.ts and useTanStackTableDevtools.d.ts for current ref handling.
常见问题
为什么我必须把表格保存在 ref 中?
这项技能说明,钩子会追踪替换,如果只解包一次 ref,那么注册的只是快照。
为什么我的表格被跳过了?
没有键的表格会被跳过,重复的键会互相替换,因此每个表格都需要自己的键。
注册可以关闭吗?
可以,钩子接受 enabled 选项,因此可以关闭注册。
详情
作者的原始描述
Connect Vue Table v9 refs or instances to Devtools with tableDevtoolsPlugin and useTanStackTableDevtools. Load for missing targets, reactive table replacement, required options.key, enabled state, cleanup, or development gating.
repo: TanStack/table
热度
- GitHub 星标
- 29k
- 排名
- #9840
- 许可证
- MIT
- 更新时间
- 2026/10/21
评论
- …
同一仓库的更多技能
getting-started
29k教你的智能体如何在 Alpine.js 中使用 TanStack Table 构建并显示数据表格,涵盖设置、响应式数据和渲染行。
table-state
29k教你的智能体如何在 Alpine.js 中读取和控制表格状态,例如当前页码,使状态变化时屏幕能够更新。
devtools
29k教你的智能体如何把 Angular 表格注册到 TanStack Devtools 面板中,使开发者在构建应用时能检查每个表格。
getting-started
29k教你的智能体如何在 Angular 中创建并显示 TanStack 表格,涵盖 injectTable 设置、模板渲染和行数据的更新。