Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问许可证需确认审计通过

vue-startVue start 搜索

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

220

周安装

9

GitHub Stars

14,270

下载量

71
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:vue-start(Vue start 搜索)
来源仓库:https://github.com/tanstack/router
仓库路径:skills/vue-start
安装命令:
npx skills add https://github.com/tanstack/router --skill vue-start
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/tanstack/router --skill vue-start

简介

用于 Vue 项目初始化和相关搜索支持。

  • 适合查找 Vue 生态工具和最佳实践资料。
  • 可协助获取 Vue 相关资源和技术文档。
  • 建议结合具体项目需求选择合适工具链。vue-start 属于研究检索类 Skill,可作为该场景下的辅助能力补充。
  • 安装方式:通过 GitHub 仓库安装,适用于 Claude 等宿主。

SKILL.md

Vue Start (@tanstack/vue-start)

This skill builds on start-core. Read start-core first for foundational concepts.

This skill covers the Vue-specific bindings, setup, and patterns for TanStack Start.

CRITICAL: All code is ISOMORPHIC by default. Loaders run on BOTH server and client. Use createServerFn for server-only logic.
CRITICAL: Do not confuse @tanstack/vue-start with Nuxt. They are completely different frameworks with different APIs.
CRITICAL: Types are FULLY INFERRED. Never cast, never annotate inferred values.

Package API Surface

@tanstack/vue-start re-exports everything from @tanstack/start-client-core plus:

  • useServerFn — Vue composable for calling server functions from components

All core APIs (createServerFn, createMiddleware, createStart, createIsomorphicFn, createServerOnlyFn, createClientOnlyFn) are available from @tanstack/vue-start.

Server utilities (getRequest, getRequestHeader, setResponseHeader, setCookie, getCookie, useSession) are imported from @tanstack/vue-start/server.

Full Project Setup

1. Install Dependencies

npm i @tanstack/vue-start @tanstack/vue-router vue
npm i -D vite @vitejs/plugin-vue @vitejs/plugin-vue-jsx typescript

2. package.json

{
  "type": "module",
  "scripts": {
    "dev": "vite dev",
    "build": "vite build",
    "start": "node .output/server/index.mjs"
  }
}

3. tsconfig.json

{
  "compilerOptions": {
    "jsx": "preserve",
    "jsxImportSource": "vue",
    "moduleResolution": "Bundler",
    "module": "ESNext",
    "target": "ES2022",
    "skipLibCheck": true,
    "strictNullChecks": true
  }
}

4. vite.config.ts

import { defineConfig } from 'vite'
import { tanstackStart } from '@tanstack/vue-start/plugin/vite'
import vuePlugin from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'

export default defineConfig({
  plugins: [
    tanstackStart(), // MUST come before vue plugin
    vuePlugin(),
    vueJsx(), // Required for JSX/TSX route files
  ],
})

5. Router Factory (src/router.tsx)

import { createRouter } from '@tanstack/vue-router'
import { routeTree } from './routeTree.gen'

export function getRouter() {
  const router = createRouter({
    routeTree,
    scrollRestoration: true,
  })
  return router
}

6. Root Route (src/routes/__root.tsx)

import {
  Outlet,
  createRootRoute,
  HeadContent,
  Scripts,
  Html,
  Body,
} from '@tanstack/vue-router'

export const Route = createRootRoute({
  head: () => ({
    meta: [
      { charSet: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { title: 'My TanStack Start App' },
    ],
  }),
  component: RootComponent,
})

function RootComponent() {
  return (
    <Html>
      <head>
        <HeadContent />
      </head>
      <Body>
        <Outlet />
        <Scripts />
      </Body>
    </Html>
  )
}

7. Index Route (src/routes/index.tsx)

import { createFileRoute } from '@tanstack/vue-router'
import { createServerFn } from '@tanstack/vue-start'

const getGreeting = createServerFn({ method: 'GET' }).handler(async () => {
  return 'Hello from TanStack Start!'
})

export const Route = createFileRoute('/')({
  loader: () => getGreeting(),
  component: HomePage,
})

function HomePage() {
  const greeting = Route.useLoaderData()
  return <h1>{greeting.value}</h1>
}

useServerFn Composable

Use useServerFn to call server functions from Vue components with automatic redirect handling:

import { createServerFn, useServerFn } from '@tanstack/vue-start'
import { ref } from 'vue'

const updatePost = createServerFn({ method: 'POST' })
  .inputValidator((data: { id: string; title: string }) => data)
  .handler(async ({ data }) => {
    await db.posts.update(data.id, { title: data.title })
    return { success: true }
  })

// In a component setup:
const updatePostFn = useServerFn(updatePost)
const title = ref('')

async function handleSubmit(postId: string) {
  await updatePostFn({ data: { id: postId, title: title.value } })
}

Unlike the React version, useServerFn does NOT wrap the returned function in useCallback — Vue's setup() runs once per component instance, so no memoization is needed.

Vue-Specific Components

All routing components from @tanstack/vue-router work in Start:

  • <Outlet> — renders matched child route
  • <Link> — type-safe navigation with scoped slots
  • <Navigate> — declarative redirect
  • <HeadContent> — renders head tags (must be in <head>)
  • <Scripts> — renders body scripts (must be in <body>)
  • <Await> — renders deferred data with Vue <Suspense>
  • <ClientOnly> — renders children only after onMounted
  • <CatchBoundary> — error boundary via onErrorCaptured
  • <Html> — SSR shell <html> wrapper
  • <Body> — SSR shell <body> wrapper

Composables Reference

All composables from @tanstack/vue-router work in Start. Most return Ref<T> — access via .value:

  • useRouter() — router instance (NOT a Ref)
  • useRouterState()Ref<T>, subscribe to router state
  • useNavigate() — navigation function (NOT a Ref)
  • useSearch({from})Ref<T>, validated search params
  • useParams({from})Ref<T>, path params
  • useLoaderData({from})Ref<T>, loader data
  • useMatch({from})Ref<T>, full route match
  • useRouteContext({from})Ref<T>, route context
  • Route.useLoaderData()Ref<T>, typed loader data (preferred in route files)
  • Route.useSearch()Ref<T>, typed search params (preferred in route files)

Common Mistakes

1. CRITICAL: Importing from wrong package

// WRONG — this is the SPA router, NOT Start
import { createServerFn } from '@tanstack/vue-router'

// CORRECT — server functions come from vue-start
import { createServerFn } from '@tanstack/vue-start'

// CORRECT — routing APIs come from vue-router
import { createFileRoute, Link } from '@tanstack/vue-router'

2. CRITICAL: Forgetting.value in script blocks

Most composables return Ref<T>. In <script>, access via .value.

// WRONG
const data = Route.useLoaderData()
console.log(data.message) // undefined!

// CORRECT
const data = Route.useLoaderData()
console.log(data.value.message)

3. HIGH: Missing Scripts component

Without <Scripts /> in the root route's <body>, client JavaScript doesn't load and the app won't hydrate.

4. HIGH: Vue plugin before Start plugin in Vite config

// WRONG
plugins: [vuePlugin(), tanstackStart()]

// CORRECT
plugins: [tanstackStart(), vuePlugin()]

5. HIGH: Using Html/Body incorrectly

Vue Start uses <Html> and <Body> components for the SSR document shell. On the server they render <html> and <body> tags; on the client they handle hydration properly.

// WRONG — plain HTML tags can cause hydration mismatches
function RootComponent() {
  return (
    <html>
      <body>
        <Outlet />
      </body>
    </html>
  )
}

// CORRECT — use Html and Body components
function RootComponent() {
  return (
    <Html>
      <head>
        <HeadContent />
      </head>
      <Body>
        <Outlet />
        <Scripts />
      </Body>
    </Html>
  )
}

Cross-References

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.56%
按下载量换算25

Claude

31.45%
按下载量换算22

Cursor

20.91%
按下载量换算15

Gemini CLI

9.19%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/tanstack/router --skill vue-start 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills