Logo
首页
前沿
AI热点新闻
36氦头条
博客
开源
极简简历
极简智库
瞬间
相册
友链
知识库
创作者
搜索文章 Ctrl K

Vue 3 官方文档(中文版)

返回 0
  • 导读
  • 开始
    • 简介
    • 快速上手
  • 基础
    • 创建一个应用
    • 模板语法
    • 响应式基础
    • 计算属性
    • 类与样式绑定
    • 条件渲染
    • 列表渲染
    • 事件处理
    • 表单输入绑定
    • 侦听器
    • 模板引用
    • 组件基础
    • 生命周期
  • 深入组件
    • 注册
    • Props
    • 事件
    • 组件-v-model
    • 透传-Attributes
    • 插槽
    • 依赖注入
    • 异步组件
  • 逻辑复用
    • 组合式函数
    • 自定义指令
    • 插件
  • 内置组件
    • Transition
    • TransitionGroup
    • KeepAlive
    • Teleport
    • Suspense
  • 应用规模化
    • 单文件组件
    • 工具链
    • 路由
    • 状态管理
    • 测试
    • 服务端渲染-SSR
  • 最佳实践
    • 生产部署
    • 性能优化
    • 无障碍访问
    • 安全
  • TypeScript
    • 总览
    • TS-与组合式-API
    • TS-与选项式-API
  • 进阶主题
    • 使用-Vue-的多种方式
    • 组合式-API-常见问答
    • 深入响应式系统
    • 渲染机制
    • 渲染函数-&-JSX
    • Vue-与-Web-Components
    • 动画技巧
  • API-参考
    • 全局-API
      • 应用实例
      • 通用
    • 组合式-API
      • setup
      • 响应式--核心
      • 响应式--工具
      • 响应式--进阶
      • 生命周期钩子
      • 依赖注入
      • 辅助
    • 选项式-API
      • 状态选项
      • 渲染选项
      • 生命周期选项
      • 组合选项
      • 其他杂项
      • 组件实例
    • 内置内容
      • 指令
      • 组件
      • 特殊元素
      • 特殊-Attributes
    • 单文件组件
      • 语法定义
      • script-setup
      • CSS-功能
    • 进阶-API
      • 自定义元素
      • 渲染函数
      • 服务端渲染
      • TypeScript-工具类型
      • 自定义渲染
      • 编译时标志
  • 互动教程
    • 第-1-步
    • 开始
    • 声明式渲染
    • Attribute-绑定
    • 事件监听
    • 表单绑定
    • 条件渲染
    • 列表渲染
    • 计算属性
    • 生命周期和模板引用
    • 侦听器
    • 组件
    • Props
    • Emits
    • 插槽
    • 你做到了!
  • 风格指南
    • 概览
    • A---必要的
    • B---强烈推荐
    • C---推荐
    • D---谨慎使用
  • 关于
    • 常见问题
    • 版本发布
    • 社区指南
    • 关于中文翻译

Style Guide

This is the official style guide for Vue-specific code. If you use Vue in a project, it's a great reference to avoid errors, bikeshedding, and anti-patterns. However, we don't believe that any style guide is ideal for all teams or projects, so mindful deviations are encouraged based on past experience, the surrounding tech stack, and personal values.

For the most part, we also avoid suggestions about JavaScript or HTML in general. We don't mind whether you use semicolons or trailing commas. We don't mind whether your HTML uses single-quotes or double-quotes for attribute values. Some exceptions will exist however, where we've found that a particular pattern is helpful in the context of Vue.

Finally, we've split rules into four categories:

Rule Categories

Priority A: Essential (Error Prevention)

These rules help prevent errors, so learn and abide by them at all costs. Exceptions may exist, but should be very rare and only be made by those with expert knowledge of both JavaScript and Vue.

  • See all priority A rules

Priority B: Strongly Recommended

These rules have been found to improve readability and/or developer experience in most projects. Your code will still run if you violate them, but violations should be rare and well-justified.

  • See all priority B rules

Priority C: Recommended

Where multiple, equally good options exist, an arbitrary choice can be made to ensure consistency. In these rules, we describe each acceptable option and suggest a default choice. That means you can feel free to make a different choice in your own codebase, as long as you're consistent and have a good reason. Please do have a good reason though! By adapting to the community standard, you will:

  1. Train your brain to more easily parse most of the community code you encounter
  2. Be able to copy and paste most community code examples without modification
  3. Often find new hires are already accustomed to your preferred coding style, at least in regards to Vue
  • See all priority C rules

Priority D: Use with Caution

Some features of Vue exist to accommodate rare edge cases or smoother migrations from a legacy code base. When overused however, they can make your code more difficult to maintain or even become a source of bugs. These rules shine a light on potentially risky features, describing when and why they should be avoided.

  • See all priority D rules
目录
    共 124 篇 Vue 3 官方文档(中文版) / 概览 0 字 0 行 cosolar
    创建 2026-11-08T09:54:58.748039909Z 更新 2026-11-08T09:57:30.476836547Z
    Logo

    以极简为笔,以求索为墨。 简单书写,深度思考,每一次记录,都是与内心的对话。

    30,291 访问量
    219 点赞数
    0 评论数
    162 文章数 13 分类数 243 标签数
    2026-06-06 建站时间
    中国·北京 博主地址

    订阅更新

    订阅我们的技术文章,每周精选内容送达你的邮箱

    隐私政策 | 使用条款 | 友情链接 | 关于我们
    本主题由 腾讯云 提供云服务
    © 极简笔记 版权所有 津ICP备2026156702号-1
    Powered by Halo Theme halo-theme-cosolar