Skip to content
This repository was archived by the owner on Aug 8, 2022. It is now read-only.

style: Unified style #203

Merged
merged 6 commits into from
Oct 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/guide/migration/custom-directives.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ Vue.directive('highlight', {

- bind → **beforeMount**
- inserted → **mounted**
- **beforeUpdate**:<sup style="color:green">新的!</sup>这是在元素本身更新之前调用的,很像组件生命周期钩子
- update → <sup style="color:red">移除!</sup>有太多的相似之处要更新,所以这是多余的,请改用 `updated`
- **beforeUpdate**新的!这是在元素本身更新之前调用的,很像组件生命周期钩子
- update → 移除!有太多的相似之处要更新,所以这是多余的,请改用 `updated`
- componentUpdated → **updated**
- **beforeUnmount** <sup style="color:green">新的!</sup>与组件生命周期钩子类似,它将在卸载元素之前调用。
- **beforeUnmount**新的!与组件生命周期钩子类似,它将在卸载元素之前调用。
- unbind -> **unmounted**

最终 API 如下:
Expand Down Expand Up @@ -107,7 +107,7 @@ mounted(el, binding, vnode) {

## 实施细节

在 Vue 3 中,我们现在支持片段,这允许我们为每个组件返回多个 DOM 节点。你可以想象,对于具有多个 lis 的组件或一个表的子元素这样的组件有多方便:
在 Vue 3 中,我们现在支持片段,这允许我们为每个组件返回多个 DOM 节点。你可以想象,对于具有多个 `<li>` 的组件或一个表的子元素这样的组件有多方便:

```html
<template>
Expand All @@ -127,4 +127,4 @@ mounted(el, binding, vnode) {
<div @vnodeMounted="myHook" />
```

这与属性 fallthrough 行为是一致的,因此,当子组件在内部元素上使用 `v-bind="$attrs"` 时,它也将应用对其使用的任何自定义指令。
这与属性 fallthrough 行为是一致的,因此,当子组件在内部元素上使用 `v-bind="$attrs"` 时,它也将应用对其使用的任何自定义指令。
6 changes: 3 additions & 3 deletions src/guide/migration/custom-elements-interop.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ badges:

## 概览

- **BREAKING:**自定义元素白名单现在在模板编译期间执行,应该通过编译器选项而不是运行时配置来配置。
- **BREAKING:**特定 `is` prop 用法仅限于保留的 `<component>` 标记
- **NEW:**有了新的 `v-is` 指令来支持 2.x 用例,其中在原生元素上使用了 `v-is` 来处理原生 HTML 解析限制。
- **非兼容**:自定义元素白名单现在在模板编译期间执行,应该通过编译器选项而不是运行时配置来配置。
- **非兼容**:特定 `is` prop 用法仅限于保留的 `<component>` 标记
- **新**:有了新的 `v-is` 指令来支持 2.x 用例,其中在原生元素上使用了 `v-is` 来处理原生 HTML 解析限制。

## 自主定制元素

Expand Down
2 changes: 1 addition & 1 deletion src/guide/migration/fragments.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ badges:
</template>
```

## 3.x Synta 语法 x
## 3.x 语法

在 3.x 中,组件现在可以有多个根节点!但是,这确实要求开发者明确定义属性应该分布在哪里。

Expand Down