Skip to content
持续编写中 - 仅供预览
Vue.js
Search
⌘
K
Main Navigation
文档
指引
教程
范例
快速开始
风格指南
从 Vue 2 迁移
API
Playground
生态系统
资源
合作伙伴
主题
工作
T-Shirt 商店
视频教程
Vue Mastery
Vue School
帮助
Discord 聊天室
论坛
DEV Community
News
博客
Twitter
新闻
活动
语言
简体中文
English
关于
FAQ
团队
版本发布
社区指南
行为准则
纪录片
赞助者
languages
github
twitter
discord
Appearance
languages
github
twitter
discord
API 参考
全局 API
引用
createApp()
createSSRApp()
app.mount()
app.unmount()
app.provide()
app.component()
app.directive()
app.use()
app.mixin()
app.version
app.config
app.config.errorHandler
app.config.warnHandler
app.config.performance
app.config.compilerOptions
app.config.globalProperties
app.config.optionMergeStrategies
概要
version
nextTick()
defineComponent()
defineAsyncComponent()
defineCustomElement()
组合式 API
setup()
Basic Usage
Accessing Props
Setup Context
Usage with Render Functions
响应式: 核心
ref()
computed()
reactive()
readonly()
watchEffect()
watchPostEffect()
watchSyncEffect()
watch()
响应式: 工具
isRef()
unref()
toRef()
toRefs()
isProxy()
isReactive()
isReadonly()
响应式: 进阶
shallowRef()
triggerRef()
customRef()
shallowReactive()
shallowReadonly()
toRaw()
markRaw()
effectScope()
getCurrentScope()
onScopeDispose()
生命周期钩子
onMounted()
onUpdated()
onUnmounted()
onBeforeMount()
onBeforeUpdate()
onBeforeUnmount()
onErrorCaptured()
onRenderTracked()
onRenderTriggered()
onActivated()
onDeactivated()
onServerPrefetch()
依赖注入
provide()
inject()
选项式 API
状态选项
data
props
computed
methods
watch
emits
expose
渲染选项
template
render
compilerOptions
生命周期选项
beforeCreate
created
beforeMount
mounted
beforeUpdate
updated
beforeUnmount
unmounted
errorCaptured
renderTracked
renderTriggered
activated
deactivated
serverPrefetch
组合选项
provide
inject
mixins
extends
其他杂项
name
inheritAttrs
components
directives
组件实例
$data
$props
$el
$options
$parent
$root
$slots
$refs
$attrs
$watch()
$emit()
$forceUpdate()
$nextTick()
内置内容
指令
v-text
v-html
v-show
v-if
v-else
v-else-if
v-for
v-on
v-bind
v-model
v-slot
v-pre
v-once
v-memo
v-cloak
组件
<Transition>
<TransitionGroup>
<KeepAlive>
<Teleport>
<Suspense>
特殊元素
<component>
<slot>
特殊 Attributes
key
ref
is
单文件组件
语法定义
Overview
Language Blocks
Automatic Name Inference
Pre-Processors
Src Imports
Comments
<script setup>
Basic Syntax
Reactivity
Using Components
defineProps() & defineEmits()
defineExpose()
useSlots() & useAttrs()
Usage alongside normal <script>
Top-level await
TypeScript-only Features
Restrictions
CSS 功能
Scoped CSS
CSS Modules
v-bind() in CSS
进阶 APIs
渲染函数
h()
mergeProps()
cloneVNode()
isVNode()
resolveComponent()
resolveDirective()
withDirectives()
服务端渲染
renderToString()
renderToNodeStream()
pipeToNodeWritable()
renderToWebStream()
pipeToWebWritable()
renderToSimpleStream()
useSSRContext()
TypeScript 工具类
PropType<T>
ComponentCustomProperties
ComponentCustomOptions
ComponentCustomProps
自定义渲染
createRenderer()
has loaded