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

fix: modified the translation of sentence in v-model.md file #39

Merged
merged 3 commits into from Sep 13, 2020

Conversation

zhaozhe0831
Copy link

  • 修改了多处 markdown 语法
  • 进行了多处译文校对,依据本人对 vue 的理解进行了改写

ps: 第一次担任校对,难免有不合适的地方。对于有不合适的地方,希望可以多提意见,多多交流,我好对译文再做调整。

zhaozhe added 2 commits September 10, 2020 16:10
修改了多处 markdown 语法
进行了多处译文校对,依据本人对 vue 的理解进行了改写

## 2.x 语法

在 2.x 中,在组件上使用 `v-model` 相当于传递 `value` prop 属性并触发 `input` 事件:
在 2.x 中,在组件上使用 `v-model` 相当于绑定 `value` prop 属性和 `input` 事件:
Copy link
Member

Choose a reason for hiding this comment

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

这里:相当于绑定 value prop 属性和 input 事件:,是否可以考虑移除 属性,这看起来 prop属性` 重复了

@@ -56,9 +57,9 @@ export default {
event: 'change'
},
props: {
//这允许将 `value` 属性用于其他用途
// 这将允许 value 属性用于其他用途
Copy link
Member

Choose a reason for hiding this comment

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

原文:> this allows using the value prop for a different purpose

可以考虑保留: value 的用法,不用移除:“

value: String,
// 用 `title` 作为代替 `value` 的prop
// 使用 title 代替 value 作为 model 的 prop
Copy link
Member

Choose a reason for hiding this comment

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

// 使用 title 代替 value 作为 model 的 prop

原文为:

// use title as the prop which take the place of value

不应该移除:“`”,应保留


```html
<ChildComponent :title="pageTitle" @change="pageTitle = $event" />
```

### 使用 `v-bind.sync`

在某些情况下,我们可能需要 prop “双向绑定”(有时是对不同 prop 的现有 `v-model` 的补充)。为此,我们建议使用 `update:myPropName`。例如,对于上一个示例中带有 `title` prop 的 `ChildComponent`,我们可以将分配新 value 的意图传达给
在某些情况下,我们可能需要对某一个 prop 进行“双向绑定”(除了已经用 `v-model` 绑定的那个 prop 以外的情况)。为此,我们建议使用 `update:myPropName` 抛出事件。例如,对于在上一个示例中带有 `title` prop 的 `ChildComponent`,我们可以通过下面的方式将分配新 value 的意图传达给父级
Copy link
Member

Choose a reason for hiding this comment

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

除了已经用 v-model 绑定的那个 prop 以外的情况

这块似乎阅读起来,不太自然。

可以考虑:

除了前面用 v-model 绑定 prop 的情况

@@ -110,7 +111,7 @@ this.$emit('update:title', newValue)

### `v-model` 参数

要更改 model 名,而不是 `model` 组件选项,现在我们可以将一个 _argument_ 传递给 `model`:
若需要更改 `model` 名称,而不是更改组件内的 `model` 选项,那么现在我们可以将一个 _argument_ 传递给 `model`:
Copy link
Member

Choose a reason for hiding this comment

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

一个 argument 传递给 model

这里的都统一使用:“*” 来做斜体吧。

@@ -184,7 +185,7 @@ this.$emit('update:title', newValue)

## 下一步

更多新的 `v-model` 语法信息,见
更多新的 `v-model` 语法相关信息,请浏览
Copy link
Member

Choose a reason for hiding this comment

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

更多新的 v-model 语法相关信息,请浏览:

建议改为:

更多新的 v-model 语法相关信息,请参考:

出于这个的原因是,现在大量使用:“参考” 这一词。

@zhaozhe0831
Copy link
Author

已整体修改 @veaba

@veaba
Copy link
Member

veaba commented Sep 11, 2020

已整体修改 @veaba

感谢你的 PR 。

在等其他团队成员没有其他意见后,将 merge 到 master 分支

@Jinjiang
Copy link
Member

@veaba 我觉得我们之间有一个人 review 过就可以 merge 了。如我们之前约定的“超过社区 2 人或有 Vue 团队成员校对”即可。所以这个 PR 如果你已经 review 过那我就先 merge 了。今后的 PR 你 review 过可以直接 approve 并 merge。🙏

@Jinjiang Jinjiang merged commit 2304f9c into vuejs:master Sep 13, 2020
@veaba
Copy link
Member

veaba commented Sep 13, 2020

@veaba 我觉得我们之间有一个人 review 过就可以 merge 了。如我们之前约定的“超过社区 2 人或有 Vue 团队成员校对”即可。所以这个 PR 如果你已经 review 过那我就先 merge 了。今后的 PR 你 review 过可以直接 approve 并 merge。🙏

好的。如果内容比较复杂的话,我还是觉得留给你来review,这样能最大化保证文档的高质量。:joy:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants