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

docs: translate breaking #220

Merged
merged 3 commits into from
Oct 25, 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
16 changes: 13 additions & 3 deletions src/.vuepress/components/MigrationBadges.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
<script>
const validBadges = ['new', 'breaking', 'removed', 'updated']
const validBadges = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这部分改动我觉得可以作为更好的多语言支持 PR 回英文版

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

那我先给英文版扔个 PR

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new:"新增",
breaking:"非兼容",
removed:"移除",
updated:"更新"
}

export default {
props: {
badges: {
type: Array,
default: () => [],
validator(value) {
return value.every(badge => validBadges.includes(badge))
return value.every(badge => Object.keys(validBadges).includes(badge))
}
}
},
data(){
return {
validBadges
}
}
}
</script>
Expand All @@ -21,7 +31,7 @@ export default {
:class="`migration-badge is-${badgeType}`"
:key="`badge-type-${badgeType}`"
>
{{ badgeType }}
{{ validBadges[badgeType] }}
</span>
</div>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/guide/migration/custom-elements-interop.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ badges:

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

## 自主定制元素

Expand Down
2 changes: 1 addition & 1 deletion src/guide/migration/data-option.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ badges:

## 概览

- **breaking**:`data` 组件选项声明不再接收纯 JavaScript `object`,而需要 `function` 声明。
- **非兼容**:`data` 组件选项声明不再接收纯 JavaScript `object`,而需要 `function` 声明。

当合并来自 mixin 或 extend 的多个 `data` 返回值时,现在是浅层次合并的而不是深层次合并的(只合并根级属性)。

Expand Down
6 changes: 3 additions & 3 deletions src/guide/migration/key-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ badges:

## 概览

- **NEW**:对于 `v-if`/`v-else`/`v-else-if` 的各分支项 `key` 将不再是必须的,因为现在 Vue 会自动生成唯一的 `key`。
- **BREAKING**:如果你手动提供 `key`,那么每个分支必须使用唯一的 `key`。你不能通过故意使用相同的 `key` 来强制重用分支。
- **BREAKING**:`<template v-for>` 的 `key` 应该设置在 `<template>` 标签上 (而不是设置在它的子节点上)。
- **新增**:对于 `v-if`/`v-else`/`v-else-if` 的各分支项 `key` 将不再是必须的,因为现在 Vue 会自动生成唯一的 `key`。
- **非兼容**:如果你手动提供 `key`,那么每个分支必须使用唯一的 `key`。你不能通过故意使用相同的 `key` 来强制重用分支。
- **非兼容**:`<template v-for>` 的 `key` 应该设置在 `<template>` 标签上 (而不是设置在它的子节点上)。

## 背景

Expand Down
4 changes: 2 additions & 2 deletions src/guide/migration/keycode-modifiers.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ badges:

以下是变更的简要总结:

- **BREAKING**:不再支持使用数字 (即键码) 作为 `v-on` 修饰符
- **BREAKING**:不再支持 `config.keyCodes`
- **非兼容**:不再支持使用数字 (即键码) 作为 `v-on` 修饰符
- **非兼容**:不再支持 `config.keyCodes`

## 2.x 语法

Expand Down
2 changes: 1 addition & 1 deletion src/guide/migration/slots-unification.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ badges:
以下是变化的变更总结:

- `this.$slots` 现在将 slots 作为函数公开
- **BREAKING**:移除 `this.$scopedSlots`
- **非兼容**:移除 `this.$scopedSlots`

更多信息,请继续阅读!

Expand Down
2 changes: 1 addition & 1 deletion src/guide/migration/v-if-v-for.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ badges:

## 概览

- **BREAKING**:两者作用于同一个元素上时,`v-if` 会拥有比 `v-for` 更高的优先级。
- **非兼容**:两者作用于同一个元素上时,`v-if` 会拥有比 `v-for` 更高的优先级。

## 介绍

Expand Down
8 changes: 4 additions & 4 deletions src/guide/migration/v-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ badges:

就变化内容而言,此部分属于高阶内容:

- **BREAKING**:用于自定义组件时,`v-model` prop 和事件默认名称已更改:
- **非兼容**:用于自定义组件时,`v-model` prop 和事件默认名称已更改:
- prop:`value` -> `modelValue`;
- event:`input` -> `update:modelValue`;
- **BREAKING**:`v-bind` 的 `.sync` 修饰符和组件的 `model` 选项已移除,可用 `v-model` 作为代替;
- **NEW**:现在可以在同一个组件上使用多个 `v-model` 进行双向绑定;
- **NEW**:现在可以自定义 `v-model` 修饰符。
- **非兼容**:`v-bind` 的 `.sync` 修饰符和组件的 `model` 选项已移除,可用 `v-model` 作为代替;
- **新增**:现在可以在同一个组件上使用多个 `v-model` 进行双向绑定;
- **新增**:现在可以自定义 `v-model` 修饰符。

更多信息,请见下文。

Expand Down