匠人学院 JR Academy
  • Position

    Where am I now, and where should I go?

    How your job is changing, where your experience can take you and what you still need for a target role, worked out from what you have actually done. Free, and the full result needs no sign-up.

    Analyse my career and skills

    Look up a career

    Will AI replace my job?AI impact and transition paths for common careersNew jobs in the AI eraWhat they do, what they need, how to move in

    Focused tools

    AI Engineer interview readiness30 timed questions on what you still need before interviewsCareer personality testDirections that suit how you workReturning to China checkJob prospects in China by school, major and graduation date

    AI coach

    Talk to your AI coachStill unsure after your result? Talk through what is holding you back
  • Core courses

    AI Engineer BootcampEngineering bootcamp from LLM apps to agentsAI Engineer Full-Stack Project Class16 weeks · RAG and full-stack AI projectsVibe Coding Masterclass8 weeks · direct agents to build and ship a productAI Essentials10 hours · use AI for email, reports, data and copyAI Office Automation Course8 weeks · help a whole company adopt AIOne-Person Company (OPC) Bootcamp15 weeks in person · build a one-person company with AIAll courses →

    AI engineering

    Machine Learning & Data Engineering Full-Stack ClassAI Agent & MCP Project BootcampAI Engineer Core TechniquesAI Engineer FoundationsAI Engineer Advanced: RAG to Agents and TuningClaude Code TasterAll AI engineering courses →

    AI at work

    AI Coding for everyoneClaude Code One-Day Masterclass (Non-Technical)Enterprise AI Automation BootcampAI Marketing BootcampAI Risk, Governance and Audit CourseOpenClaw 4-Week Personal AI Assistant BootcampAll AI-at-work courses →

    Career development

    AI Product Manager (BA) Bootcamp + InternshipAustralia IT Interview BootcampAustralia IT Technical Interview BootcampAustralia IT Resume BootcampAustralia Big Tech Job Search BootcampAustralia IT Career Planning BootcampAll career courses →

    Learn free first

    Vibe CodingAI for office workPrompt MasterAI EngineerAI data analysisResource centerInstructorsAll learning paths →
  • Evidence

    What will convince an employer?

    Certifications, projects, team work and competition entries, collected into one portfolio.

    See the portfolio

    Certifications

    Cert Master · all certificationsPrep and mock exams for AWS, Azure, GCP, Claude and moreAWS CLF-C02Entry-level AWS cloud certificationAWS SAA-C03Entry certification for cloud architectsClaude certificationsAnthropic Claude certification seriesAll certifications →

    Projects and team work

    P3 team projectsBuild a project with real teammates in a simulated team workflowP3 project experienceThe parts of a P3 project that go on your resumeDemo DayProject showcaseP3 certificatesProof once a project is completeAll of P3 →

    Competitions and work

    HackathonsBuild something against the clockSubmit your workAdd your project to the showcaseCareerOS portfolioDo tasks in the desktop app; your results become portfolio pieces
    Cert MasterBrowser extension, app and mini programScreenshot a question for analysis and practise anywhereAbout Cert Master
  • Connect

    How do I get myself in front of employers?

    Resume, interviews, referrals and mentors. See how far you are from the target role first, then decide what to fix.

    Start with Jobpin

    Resume and openings

    Graduate careersGraduate preparation across Australia, China, Malaysia, Singapore, the US and UKJobpinAI job search workspace: resume, roles, applicationsAI resumeRewrite your resume against a job descriptionReferralsRoles shared by students and mentorsOpportunitiesInternships, projects and collaborationsOffer boardOffers students have received

    Interviews

    AI Engineer interview guideSeven areas, with worked examplesFDE interview guideFive rounds, from scoping to the customer roundAI mock interviewPractise by text or voice and see the gapsInterview storiesReal interview experiencesSystem Design handbookPrepare for system design interviewsAll interview prep →

    Mentors

    1:1 mentorsBook AI, career and technical mentors by the hourGroup tutoringShare a tutor with a few others and pay less eachCareer coachingResume, interview and direction packages
    Jobpin desktopOne workspace for the whole job searchOrganise real experience and refine resume versions for target roles on macOS or Windows.About Jobpin
BusinessMembershipDownload CareerOS
0
匠人学院 JR Academy

Follow Us

linkedinfacebooktwitterinstagramyoutube

We Accept

/image/layout/pay-paypal.png/image/layout/pay-visa.png/image/layout/pay-master-card.png/image/layout/pay-airwallex.png/image/layout/pay-alipay.png
Airbotix · AI learning & creation for kids Another Life · AI story game
Products46

CareerOS and tools

  • CareerOS
  • Cert Master
  • Jobpin
  • Jobpin web
  • Jobpin report
  • Jobpin desktop download
  • My job search reports
  • Buy report credits
  • Jobpin billing
  • AI Toolbox
  • AI Skill Marketplace

Membership

  • Membership
  • AI membership

Courses

  • Bootcamps
  • Training Camp
  • Kanban learning
  • AI Builder course
  • MCP course
  • NotebookLM workshop
  • Business Analyst course
  • Web Full-Stack Bootcamp
  • DevOps Bootcamp
  • Data Engineering Bootcamp
  • Data Analysis Bootcamp
  • Coding for Beginners
  • Algorithm Bootcamp

Career services

  • Graduate careers
  • Graduate careers in Australia
  • Graduate careers in China
  • Graduate careers in Malaysia
  • Graduate careers in Singapore
  • Graduate careers in the US
  • Graduate careers in the UK
  • 1:1 coaching
  • Career coaching
  • AI Engineer VIP
  • BA & PM Internship
  • Data Science Internship
  • Data Analysis Internship
  • Marketing Internship
  • Resume Review
  • Interview Coaching
  • Job Application Service
  • Job Monitoring
  • LinkedIn Management
  • LinkedIn Networking
Library57

Learning paths

  • All Learning Paths
  • AI Engineer
  • Context Engineering
  • Vibe Coding
  • Prompt Master
  • AI Builder
  • AI Product Manager
  • Python Basics
  • AI Productivity
  • AI Data Analysis
  • AI Finance
  • AI Content Creation
  • AI Image Creation
  • Frontend Development
  • Hermes Agent
  • OpenClaw Local Agent

Interactive labs

  • Prompt Lab
  • Frontend Lab
  • JavaScript Lab
  • Python Lab
  • AWS Lab
  • Azure Lab
  • LLM Lab
  • Git Lab

Reference and guides

  • Resources
  • Wiki
  • Cheat sheets
  • Roadmaps
  • AI roadmaps
  • Videos
  • Ebooks
  • Blog
  • Interview handbook
  • Mock exams
  • Free resources

Cities

  • Sydney
  • Melbourne
  • Brisbane
  • Adelaide
  • Singapore
  • Kuala Lumpur
  • London
  • New York
  • San Francisco
  • Los Angeles
  • Seattle
  • Toronto
  • Vancouver

Immigration

  • Australia Immigration
  • Skilled Visa 189/190/491
  • Employer Sponsored 482/186/494
  • Business Visa 188/888
  • UK Immigration
  • US Immigration
  • Canada Immigration
  • Singapore immigration
  • Malaysia immigration
Business20

For business

  • AI for Business
  • Business portal sign-in
  • Corporate Training
  • Internship Partnership
  • Recruitment Partnership
  • Enterprise (EN)

Metatree AI Lab

  • Metatree AI Lab (Chinese)
  • AI solutions (Chinese)
  • Digital employees (Chinese)
  • Case studies (Chinese)
  • Metatree AI Lab
  • AI services
  • Digital employees
  • Case studies

AI education for kids

  • Airbotix — AI Learning & Creation for Kids
  • AU Family Resource Hub
  • NAPLAN Report Guide
  • My School Data Guide
  • Sydney Private School Fees 2026
  • Kids Coding Programs
About15

Company

  • About Us
  • Our Mentors
  • Become a Mentor
  • Metaverse Classroom
  • JR Careers
  • Another Life — AI Story Game
  • Contact Us

Help and policies

  • FAQs
  • Terms & Conditions
  • Privacy Policy
  • Cancellation & Refund Policy
  • Site map

Friend links

  • CS Browser

Contact

  • hello@jiangren.com.au
  • 0421-672-555

Offices

Level 10b, 144 Edward Street, Brisbane CBD (Headquarter)
Level 2, 171 La Trobe St, Melbourne VIC 3000
45A13, Block B, Oriental Hope Tianxiang Plaza, 500 Tianfu Avenue Middle Section, Wuhou District, Chengdu, Sichuan, China
Business Hub, 155 Waymouth St, Adelaide SA 5000
Disclaimer
footer-disclaimerfooter-disclaimer

JR Academy acknowledges Traditional Owners of Country throughout Australia and recognises the continuing connection to lands, waters and communities. We pay our respect to Aboriginal and Torres Strait Islander cultures; and to Elders past and present. Aboriginal and Torres Strait Islander peoples should be aware that this website may contain images or names of people who have since passed away.

All content on the JR Academy website, including course materials, logos, and information provided, is protected under Australian intellectual property laws. Unauthorized use, sale, distribution, reproduction, or modification is strictly prohibited. Violations may result in legal action. By accessing our website, you agree to respect our intellectual property. JR Academy Pty Ltd reserves all rights, including patents, trademarks, and copyrights. Any infringement will be subject to legal prosecution. View Terms of Service

© 2017-2026 JR Academy Pty Ltd. All rights reserved.

ABN 26621887572

HomeLearnCoursesCerts
  1. Home
  2. Learn
  3. Blog
  4. v0 实战指南:AI 驱动的全栈应用构建 — 核心功能详解
JR Academy · BlogCareer insights

v0 实战指南:AI 驱动的全栈应用构建 — 核心功能详解

Design Mode、Git 工作流、数据库连接、Figma 导入——v0 的核心功能逐个拆解

Published2026-12-01
Reading time4 min
Author

Contents

  • Design Mode:免费的可视化编辑
  • Git 集成:正经的工程化工作流
  • 数据库连接
  • Figma 导入
  • MCP 集成
  • Generative UI 实战:从零生成 Analytics Dashboard
  • 目标
  • 第一轮提示词
  • 第二轮:拆分数据层
  • 第三轮:接真实 API
  • 整个流程的时间消耗
  • shadcn/ui 集成细节
  • shadcn/ui 不是 npm 包
  • v0 生成的代码 + 本地 shadcn 组件对齐
  • 自定义 Design System
  • Tailwind 版本注意事项
  • 从 shadcn/ui 官网到 v0
  • 各功能的 credits 消耗对比

Design Mode:免费的可视化编辑

v0 最被低估的功能。切换到 Design Mode 后,你可以直接点击页面上的任何元素,修改:

  • 颜色(背景、文字、边框)
  • 字体大小和字重
  • 间距(padding、margin)
  • 文本内容
  • 布局方式

v0 Design Mode

关键点:Design Mode 的所有操作不消耗 credits。微调样式全在这里做,把 AI 生成留给结构性改动,每月 $5 额度能多撑好几倍。

Design Mode 底层是直接操作 Tailwind class,改完后点「Apply」,右侧 diff 面板会显示对应的 className 变化。这意味着你看到的不是魔法——每一次点选都对应着真实的代码改动,合并到项目里不会有任何 "魔法属性" 残留。

Git 集成:正经的工程化工作流

2026 年 2 月加的 Git 面板让 v0 从玩具变成了正经工具:

# v0 在幕后做的事情:
git checkout -b v0/feature-dashboard   # 每个聊天自动创建分支
git commit -m "Add KPI cards"          # 每条消息自动 commit
# 永远不会直接推到 main

工作流:

  1. 每个聊天会话自动创建独立分支
  2. 每条消息生成的改动自动 commit
  3. 通过 Git 面板查看 diff
  4. 直接在 v0 里对 main 开 Pull Request
  5. 合并后自动触发 Vercel 部署

也可以反向操作:把你的 GitHub 仓库导入 v0,在 AI 界面里改代码,改完提 PR。

实战技巧:给 v0 的每个聊天起有意义的名字(比如"dashboard-kpi-cards"),这样 Git 分支名会带上这个名字,review 时一眼知道这个 PR 做了什么。

数据库连接

v0 通过 Vercel Marketplace 支持三个数据库:

数据库 类型 适合场景
Neon Serverless PostgreSQL 需要 SQL 的常规应用
Supabase PostgreSQL + Auth + 实时订阅 需要认证和实时功能
Upstash Redis 兼容 KV 存储 缓存、限流、会话管理

跟 v0 说"帮我加一个数据库",它引导你从 Marketplace 选择并一键配置,自动生成 schema、API 路由和 CRUD 操作。比如加用户认证,v0 会生成:

// app/api/auth/route.ts
import { createClient } from '@supabase/supabase-js'

const supabase = createClient(
  process.env.NEXT_PUBLIC_SUPABASE_URL!,
  process.env.SUPABASE_SERVICE_ROLE_KEY!
)

export async function POST(request: Request) {
  const { email, password } = await request.json()
  const { data, error } = await supabase.auth.signUp({ email, password })
  if (error) return Response.json({ error: error.message }, { status: 400 })
  return Response.json({ user: data.user })
}

Figma 导入

两种方式:截图导入(分析布局颜色生成代码)和 Figma 链接导入(Premium 及以上,提取设计 token,保真度更高)。

建议把设计拆成小组件逐个生成再组合,别一次丢整个页面。

MCP 集成

v0 支持 Model Context Protocol,可连接 Stripe、Supabase 等外部服务。连接后 v0 生成代码时自动考虑已接入的服务,省去手动配置。


Generative UI 实战:从零生成 Analytics Dashboard

这是 v0 最有说服力的使用场景。把下面这个流程走一遍,你会理解"generative UI"不是噱头。

目标

生成一个 Analytics Dashboard,包含:

  • 顶部 4 个 KPI 卡片(访客数、转化率、营收、活跃用户)
  • 折线图(过去 30 天趋势)
  • 数据表格(Top 10 页面)
  • 侧边导航

第一轮提示词

Create an analytics dashboard with:
- 4 KPI cards: Visitors (124,500), Conversion rate (3.2%), Revenue ($48,200), Active users (8,940)
- A line chart showing 30-day visitor trend
- A table showing top 10 pages by pageviews
- Left sidebar navigation with: Dashboard, Analytics, Reports, Settings

Use shadcn/ui components. Dark header, white content area.

v0 会一次性生成完整的组件树,用到的 shadcn 组件包括:Card、CardHeader、CardContent、Table、TableRow、TableCell、图表部分用 Recharts。

第二轮:拆分数据层

v0 的第一版通常把数据硬编码在组件里。第二步要把数据抽出来:

Refactor the KPI cards to accept a `metrics` prop. 
Extract the table data into a `pageData` array. 
Make the chart accept a `chartData` prop instead of hardcoded values.

重构后的接口变成:

interface MetricsCardProps {
  title: string
  value: string | number
  change: number      // 环比变化百分比
  trend: 'up' | 'down'
}

interface PageTableRow {
  page: string
  views: number
  bounce: number
  avgTime: string
}

第三轮:接真实 API

Add a useEffect to fetch KPI data from /api/analytics/metrics 
and page data from /api/analytics/pages. 
Show skeleton loaders while fetching.

v0 会加上 Suspense/skeleton 状态,用 shadcn 的 Skeleton 组件占位,让加载体验不再是白屏。

生成的 fetch 逻辑大概是:

// components/dashboard/kpi-cards.tsx
'use client'

import { useEffect, useState } from 'react'
import { Skeleton } from '@/components/ui/skeleton'
import { Card, CardHeader, CardContent } from '@/components/ui/card'

export function KpiCards() {
  const [metrics, setMetrics] = useState<MetricsCardProps[] | null>(null)

  useEffect(() => {
    fetch('/api/analytics/metrics')
      .then(r => r.json())
      .then(setMetrics)
  }, [])

  if (!metrics) {
    return (
      <div className="grid grid-cols-4 gap-4">
        {Array.from({ length: 4 }).map((_, i) => (
          <Card key={i}>
            <CardHeader><Skeleton className="h-4 w-24" /></CardHeader>
            <CardContent><Skeleton className="h-8 w-32" /></CardContent>
          </Card>
        ))}
      </div>
    )
  }

  return (
    <div className="grid grid-cols-4 gap-4">
      {metrics.map(m => <MetricsCard key={m.title} {...m} />)}
    </div>
  )
}

整个流程的时间消耗

步骤 传统开发 用 v0
搭组件结构 3-4 小时 5 分钟(1 条提示)
拆 props / 抽数据层 1-2 小时 3 分钟(1 条提示)
加 loading 状态 30 分钟 2 分钟
接真实 API 手动,因人而异 手动(v0 给骨架,逻辑自己填)

Dashboard 这种组件重、样式繁的场景,v0 节省的时间集中在结构搭建和样式对齐,逻辑层仍需人工处理。


shadcn/ui 集成细节

v0 天然以 shadcn/ui 作为组件库,理解它们的关系能避免很多重复工作。

shadcn/ui 不是 npm 包

这是最常见的误解。shadcn/ui 不像 MUI 或 Ant Design,你不会在 package.json 里看到 "shadcn-ui": "^x.x.x"。它的模式是:复制组件源码到你的项目。

# 安装 shadcn CLI(2026 年 3 月 CLI v4 发布)
npx shadcn-ui@latest init

# 添加单个组件 —— 实际上是把源码复制进你的项目
npx shadcn-ui@latest add button
npx shadcn-ui@latest add card table skeleton

# 组件会出现在 components/ui/ 目录下
# 你可以直接改它们,没有任何限制

组件文件结构:

components/
  ui/
    button.tsx      # 你可以随意修改这个文件
    card.tsx
    table.tsx
    skeleton.tsx

v0 生成的代码 + 本地 shadcn 组件对齐

v0 生成代码时默认使用 shadcn/ui 组件,但如果你已有本地的 components/ui/,需要确保版本一致。

最干净的做法:

  1. 在 v0 完成生成后,从预览界面点 「Copy CLI command」,它会给你一行 npx v0 add [component-id] 命令
  2. 在本地项目根目录运行这条命令,v0 会把组件以 shadcn/ui 格式写入 components/ui/
  3. 如果组件已存在,CLI 会询问是否覆盖
# v0 生成的 CLI 命令示例
npx v0 add OPIIyrhYORH

# 等价于把 v0 里的 dashboard 组件
# 以 shadcn 格式写入你的项目

自定义 Design System

2026 年 v0 支持上传你的 tailwind.config.ts 和 globals.css,让 v0 生成的组件直接匹配你的品牌色系。

配置入口:v0 左侧 Settings → Design System

上传后,v0 生成的所有代码会用你定义的 CSS 变量替代默认值:

/* 你的 globals.css */
:root {
  --primary: 220 90% 56%;        /* 你的品牌蓝 */
  --primary-foreground: 0 0% 100%;
  --radius: 0.375rem;            /* 比默认稍小的圆角 */
}

v0 生成时会自动用这套变量,而不是 shadcn 默认的 slate 色系。

Tailwind 版本注意事项

v0 目前生成的代码默认使用 Tailwind v3 语法。如果你的项目已升级到 Tailwind v4(2025 年底发布),需要留意几处差异:

  • v4 用 @import "tailwindcss" 代替 @tailwind base/components/utilities
  • v4 的 theme() 函数语法有变化
  • v0 生成的部分 class 在 v4 下需要小幅调整(主要是 divide-* 和 ring-offset-*)

遇到这类问题,直接在 v0 里说「我用 Tailwind v4,请更新语法」,它会帮你转换。

从 shadcn/ui 官网到 v0

另一个常用路径:在 ui.shadcn.com 看到一个现成的 Block 或 Component,点「在 v0 中打开」按钮,直接进入 v0 编辑模式对那个组件做定制改造。

这比从零写提示词快很多——组件的基础结构已经有了,你只需要告诉 v0 要改什么。


各功能的 credits 消耗对比

实际使用时经常困惑"这个操作要不要消耗 credits",下面是汇总:

操作 消耗 credits
发一条新的生成请求 ✅ 是
Design Mode 调整样式 ❌ 否
查看历史版本 ❌ 否
Fork 别人的 v0 项目 ❌ 否
在 v0 里运行代码(Preview) ❌ 否
重新生成(Regenerate) ✅ 是
追加修改(在同一聊天里发新消息) ✅ 是

每月免费额度(Free 计划)大约够跑 20-30 次生成。Premium 计划($20/月)额度显著更高,且支持更复杂的生成(多文件项目、更长的上下文)。


掌握这些核心功能后,下一章讲 v0 的高级使用技巧——包括如何写让 v0 少返工的提示词、如何处理复杂交互逻辑、以及什么场景下 v0 不如手写。

Author
Share or copy the link
← Previous articlev0 实战指南:AI 驱动的全栈应用构建 — 注册到第一个项目上线Next article →v0 实战指南:AI 驱动的全栈应用构建 — 高手进阶:Prompt 技巧与实战案例

Related articles

USYD 医疗初创盘点、网络平台注意义务法案、全身 MRI 广告研究

2026-12-02

UQ 皮肤癌在线硕士开办 20 周年、中澳绿色钢铁对话、HIV 预防提醒

2026-12-02

UNSW iFire 2.3 火场模拟系统、AI 卵巢癌预后研究、艺术家与 AI 版权调查

2026-12-02

ANS-C01 退役倒计时 29 天 · AIB-C01 Beta $50 新认证上线 · MLA-C02 Beta 报名开放

2026-12-02

Amazon开放首个自研大模型Ergo,代理作弊率实测差距悬殊,Anthropic格密码结果暂无现实威胁

2026-12-02

GitHub Copilot 实战指南 — Copilot AI Code Review:30 秒让 AI 帮你审 PR,三档深度随需切换

2026-12-01
View all articles →

Done reading? Next steps

Not sure what to learn next? Tell us where you are

Tell us what you do now and where you want to go. See your gaps in skills, evidence, experience, expression and positioning, and what to work on first. No sign-in needed.

Compare with my situation
  • SkillAI Coding for EveryoneShip real products with Cursor + AI, no coding background needed. The 6-week Foundation track builds 4 deliverables; the 8-week Advanced track adds an Admin CMS, a chatbot and a data dashboard.See the program →
  • PositioningLearning roadmaps by roleFrontend, backend, data, AI and more, laid out stage by stage in the order to learn them.All roadmaps →
  • ExpressionTry an AI mock interviewPick a role and run a mock interview to practise explaining your experience and projects.Practise now →

Not sure what to do next?

Take this page's topic with you and see where your gaps are.

Compare with my situation
JR Academy
AI learning for the global Chinese community
BootcampsFree resourcesLearn AICareer coaching
精选推荐
AI Career Impact Map
Assess career exposure and explore transition paths and learning options
Popular tool
AI & Data Bootcamps
Build your skills through structured courses and hands-on projects
Popular courses
1:1 Career Coaching
Work with an experienced mentor on your resume and interview preparation
Career coaching
Custom Corporate Training
AI training tailored to your team
Business services
Popular tags
Vibe CodingAI codingCursorClaudeJob searchPromptFrontend developmentBackend development
Subscribe to updates

Receive AI learning resources, technical tutorials and career advice by email.

We respect your privacy and do not send spam.