Skip to content

Commit 095d1ed

Browse files
authored
Update migration.md
1 parent a861d06 commit 095d1ed

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

src/guide/migration.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ mounted: function () {
228228

229229
### `v-for` 排序值
230230

231-
显然 `v-for="number in 10"` 将使得 `number` 从0到9迭代,现在变成了从1到10.
231+
显然 `v-for="number in 10"` 将使得 `number` 从0到9迭代,现在变成了从1到10
232232

233233
{% raw %}
234234
<div class="upgrade-path">
@@ -331,7 +331,7 @@ Props 现在只能单向传递。为了对父组件产生反向影响,子组
331331

332332
### 根实例的 Props <sup>弃用</sup>
333333

334-
对于一个根实例来说 (比如:用 `new Vue({ ... })` 创建的实例),只能用 `propsData` 而不是 `props`.
334+
对于一个根实例来说 (比如:用 `new Vue({ ... })` 创建的实例),只能用 `propsData` 而不是 `props`
335335

336336
{% raw %}
337337
<div class="upgrade-path">
@@ -616,7 +616,7 @@ strings.map(function (str) {
616616
{% raw %}
617617
<div class="upgrade-path">
618618
<h4>升级方式</h4>
619-
<p>运行 <a href="https://github.com/vuejs/vue-migration-helper">migration helper</a> 找出实例中的 <code>v-el</code> 和 <code>v-ref</code>.</p>
619+
 <p>运行 <a href="https://github.com/vuejs/vue-migration-helper">migration helper</a> 找出实例中的 <code>v-el</code> 和 <code>v-ref</code></p>
620620
</div>
621621
{% endraw %}
622622

@@ -672,7 +672,7 @@ strings.map(function (str) {
672672
<p v-my-directive.literal="foo bar baz"></p>
673673
```
674674

675-
to just:
675+
只是:
676676

677677
``` html
678678
<p v-my-directive="'foo bar baz'"></p>
@@ -700,7 +700,7 @@ Vue 的过渡系统有了彻底的改变,现在通过使用 `<transition>` 和
700700

701701
### 可复用的过渡 `Vue.transition` <sup>弃用</sup>
702702

703-
在新的过渡系统中,可以[通过模板复用过渡效果](http://rc.vuejs.org/guide/transitions.html#Reusable-Transitions).
703+
在新的过渡系统中,可以[通过模板复用过渡效果](http://rc.vuejs.org/guide/transitions.html#Reusable-Transitions)
704704

705705
{% raw %}
706706
<div class="upgrade-path">
@@ -818,7 +818,7 @@ methods: {
818818
}
819819
```
820820

821-
在简单的情况下这样做可以代替 `$dispatch``$broadcast`,但是对于大多数复杂情况,更推荐使用一个专用的状态管理层如:[Vuex](https://github.com/vuejs/vuex).
821+
在简单的情况下这样做可以代替 `$dispatch``$broadcast`,但是对于大多数复杂情况,更推荐使用一个专用的状态管理层如:[Vuex](https://github.com/vuejs/vuex)
822822

823823
{% raw %}
824824
<div class="upgrade-path">
@@ -935,7 +935,7 @@ self.users.filter(function (user) {
935935
<p v-for="user in users | orderBy 'name'">{{ user.name }}</p>
936936
```
937937

938-
而是在 computed 属性中使用 [lodash's `orderBy`](https://lodash.com/docs/4.15.0#orderBy) (or possibly [`sortBy`](https://lodash.com/docs/4.15.0#sortBy)):
938+
而是在 computed 属性中使用 [lodash's `orderBy`](https://lodash.com/docs/4.15.0#orderBy) (或者可能是 [`sortBy`](https://lodash.com/docs/4.15.0#sortBy)):
939939

940940
``` html
941941
<p v-for="user in orderedUsers">{{ user.name }}</p>
@@ -958,7 +958,7 @@ _.orderBy(this.users, ['name', 'last_login'], ['asc', 'desc'])
958958
{% raw %}
959959
<div class="upgrade-path">
960960
<h4>升级方式</h4>
961-
<p>运行 <a href="https://github.com/vuejs/vue-migration-helper">migration helper</a> 工具找到指令中使用的过滤器。如果有些没找到,看看<strong>控制台错误信息</strong>.</p>
961+
 <p>运行 <a href="https://github.com/vuejs/vue-migration-helper">migration helper</a> 工具找到指令中使用的过滤器。如果有些没找到,看看<strong>控制台错误信息</strong></p>
962962
</div>
963963
{% endraw %}
964964

@@ -979,13 +979,13 @@ _.orderBy(this.users, ['name', 'last_login'], ['asc', 'desc'])
979979
{% raw %}
980980
<div class="upgrade-path">
981981
<h4>升级方式</h4>
982-
<p>运行 <a href="https://github.com/vuejs/vue-migration-helper">migration helper</a> 工具找到老式的调用符号,如果有遗漏,请看<strong>控制台错误信息</strong>.</p>
982+
 <p>运行 <a href="https://github.com/vuejs/vue-migration-helper">migration helper</a> 工具找到老式的调用符号,如果有遗漏,请看<strong>控制台错误信息</strong></p>
983983
</div>
984984
{% endraw %}
985985

986986
### 内置文本过滤器 <sup>弃用</sup>
987987

988-
尽管插入文本内部的过滤器依然有效,但是所有内置过滤器已经移除了。取代的是,推荐在每个区域使用更专业的库来解决。(比如用 [`date-fns`](https://date-fns.org/) 来格式化日期,用 [`accounting`](http://openexchangerates.github.io/accounting.js/) 来格式化货币).
988+
尽管插入文本内部的过滤器依然有效,但是所有内置过滤器已经移除了。取代的是,推荐在每个区域使用更专业的库来解决。(比如用 [`date-fns`](https://date-fns.org/) 来格式化日期,用 [`accounting`](http://openexchangerates.github.io/accounting.js/) 来格式化货币)
989989

990990
对于每个内置过滤器,我们大概总结了下该怎么替换。代码示例可能写在自定义 helper 函数,方法或计算属性中。
991991

@@ -1101,12 +1101,12 @@ You may notice that:
11011101

11021102
### `slot` 样式参数 <sup>弃用</sup>
11031103

1104-
通过具名 `<slot>` 插入的片段不再保持 `slot` 的参数。请用一个包裹元素来控制样式。或者用更高级方法:通过编程方式修改内容 :[render functions](render-function.html).
1104+
通过具名 `<slot>` 插入的片段不再保持 `slot` 的参数。请用一个包裹元素来控制样式。或者用更高级方法:通过编程方式修改内容 :[render functions](render-function.html)
11051105

11061106
{% raw %}
11071107
<div class="upgrade-path">
11081108
<h4>升级方式</h4>
1109-
<p>运行 <a href="https://github.com/vuejs/vue-migration-helper">migration helper</a> 找到选择slots标签CSS选择器(例如: <code>[slot="my-slot-name"]</code>).</p>
1109+
 <p>运行 <a href="https://github.com/vuejs/vue-migration-helper">migration helper</a> 找到选择slots标签CSS选择器(例如: <code>[slot="my-slot-name"]</code>)</p>
11101110
</div>
11111111
{% endraw %}
11121112

@@ -1131,7 +1131,7 @@ You may notice that:
11311131
</keep-alive>
11321132
```
11331133

1134-
<p class="tip">当 `<keep-alive>`含有不同子组件时,应该分别影响到每一个子组件。不仅是第一个而是所有的子组件都将被忽略。</p>
1134+
<p class="tip">当 `<keep-alive>` 含有不同子组件时,应该分别影响到每一个子组件。不仅是第一个而是所有的子组件都将被忽略。</p>
11351135

11361136
`<transition>`一起使用时,确保把内容包裹在内:
11371137

@@ -1150,7 +1150,7 @@ You may notice that:
11501150
</div>
11511151
{% endraw %}
11521152

1153-
## 计算插值//todaymark
1153+
## 计算插值todaymark
11541154

11551155
### 属性内部的计算插值 <sup>弃用</sup>
11561156

@@ -1200,7 +1200,7 @@ HTML 的计算插值 (`{% raw %}{{{ foo }}}{% endraw %}`) 已经弃用,取代
12001200

12011201
### 单次绑定<sup>弃用</sup>
12021202

1203-
单次绑定 (`{% raw %}{{* foo }}{% endraw %}`) 已经弃用取代的是 [`v-once` directive](/api/#v-once).
1203+
单次绑定 (`{% raw %}{{* foo }}{% endraw %}`) 已经弃用取代的是 [`v-once` directive](/api/#v-once)
12041204

12051205
{% raw %}
12061206
<div class="upgrade-path">
@@ -1226,7 +1226,7 @@ HTML 的计算插值 (`{% raw %}{{{ foo }}}{% endraw %}`) 已经弃用,取代
12261226

12271227
### `vm.$set`
12281228

1229-
曾经的 `vm.$set` 方法已经弃用,现在这样写: [`Vue.set`](/api/#Vue-set).
1229+
曾经的 `vm.$set` 方法已经弃用,现在这样写: [`Vue.set`](/api/#Vue-set)
12301230

12311231
{% raw %}
12321232
<div class="upgrade-path">
@@ -1291,12 +1291,12 @@ methods: {
12911291

12921292
### Vue实例上的`Vue.set``Vue.delete`<sup>弃用</sup>
12931293

1294-
Vue.set 和 Vue.delete在实例上将不再起作用。现在都强制在实例的data选项中声明所有顶级响应值。如果删除实例属性或实例`$data`上的某个值,直接将它设置为null即可。
1294+
Vue.set 和 Vue.delete 在实例上将不再起作用。现在都强制在实例的data选项中声明所有顶级响应值。如果删除实例属性或实例`$data`上的某个值,直接将它设置为null即可。
12951295

12961296
{% raw %}
12971297
<div class="upgrade-path">
12981298
<h4>升级方式</h4>
1299-
<p>运行 <a href="https://github.com/vuejs/vue-migration-helper">migration helper</a> 找到实例中的 <code>Vue.set</code> 或 <code>Vue.delete</code> 。如有遗漏请参考<strong>控制台错误信息</strong>.</p>
1299+
 <p>运行 <a href="https://github.com/vuejs/vue-migration-helper">migration helper</a> 找到实例中的 <code>Vue.set</code> 或 <code>Vue.delete</code> 。如有遗漏请参考<strong>控制台错误信息</strong></p>
13001300
</div>
13011301
{% endraw %}
13021302

@@ -1307,7 +1307,7 @@ Vue.set 和 Vue.delete在实例上将不再起作用。现在都强制在实例
13071307
{% raw %}
13081308
<div class="upgrade-path">
13091309
<h4>升级方式</h4>
1310-
<p>运行 <a href="https://github.com/vuejs/vue-migration-helper">migration helper</a> 工具找到覆盖 <code>vm.$data</code>的位置。如有遗漏请参考<strong>控制台警告信息</strong>。</p>
1310+
<p>运行 <a href="https://github.com/vuejs/vue-migration-helper">migration helper</a> 工具找到覆盖 <code>vm.$data</code >的位置。如有遗漏请参考<strong>控制台警告信息</strong>。</p>
13111311
</div>
13121312
{% endraw %}
13131313

@@ -1318,7 +1318,7 @@ Vue.set 和 Vue.delete在实例上将不再起作用。现在都强制在实例
13181318
{% raw %}
13191319
<div class="upgrade-path">
13201320
<h4>升级方式</h4>
1321-
<p>运行 <a href="https://github.com/vuejs/vue-migration-helper">migration helper</a>工具找到<code>vm.$get</code>。如有遗漏请参考 <strong>控制台错误信息</strong>。</p>
1321+
<p>运行 <a href="https://github.com/vuejs/vue-migration-helper">migration helper</a>工具找到 <code>vm.$get</code> 的位置。如有遗漏请参考 <strong>控制台错误信息</strong>。</p>
13221322
</div>
13231323
{% endraw %}
13241324

@@ -1335,7 +1335,7 @@ myElement.appendChild(vm.$el)
13351335
{% raw %}
13361336
<div class="upgrade-path">
13371337
<h4>升级方式</h4>
1338-
<p>运行 <a href="https://github.com/vuejs/vue-migration-helper">migration helper</a> 工具找到 <code>vm.$appendTo</code>。如果有遗漏可以参考<strong>控制台错误信息</strong>。</p>
1338+
<p>运行 <a href="https://github.com/vuejs/vue-migration-helper">migration helper</a> 工具找到 <code>vm.$appendTo</code> 的位置。如果有遗漏可以参考<strong>控制台错误信息</strong>。</p>
13391339
</div>
13401340
{% endraw %}
13411341

@@ -1371,7 +1371,7 @@ myElement.parentNode.appendChild(vm.$el)
13711371
{% raw %}
13721372
<div class="upgrade-path">
13731373
<h4>升级方式</h4>
1374-
<p>运行 <a href="https://github.com/vuejs/vue-migration-helper">migration helper</a> 找到<code>vm.$after</code>。如有遗漏,请参考<strong>控制台错误信息</strong>.</p>
1374+
 <p>运行 <a href="https://github.com/vuejs/vue-migration-helper">migration helper</a> 找到 <code>vm.$after</code> 的位置。如有遗漏,请参考<strong>控制台错误信息</strong></p>
13751375
</div>
13761376
{% endraw %}
13771377

@@ -1398,8 +1398,8 @@ vm.$el.remove()
13981398

13991399
{% raw %}
14001400
<div class="upgrade-path">
1401-
<h4>Upgrade Path</h4>
1402-
<p>Run the <a href="https://github.com/vuejs/vue-migration-helper">migration helper</a> on your codebase to find examples of <code>vm.$eval</code>. If you miss any, you'll see <strong>console errors</strong>.</p>
1401+
<h4>升级方式</h4>
1402+
 <p>运行 <a href="https://github.com/vuejs/vue-migration-helper">migration helper</a> 工具找到使用 <code>vm.$eval</code> 的位置。如有遗漏请参考<strong>控制台错误信息</strong></p>
14031403
</div>
14041404
{% endraw %}
14051405

@@ -1486,7 +1486,7 @@ Async is now required for rendering performance.
14861486

14871487
### `Vue.config.delimiters` <sup>弃用</sup>
14881488

1489-
[模板选项](/api/#delimiters)的方式使用。这样可以 可以在使用自定义分隔符时避免影响第三方模板
1489+
[模板选项](/api/#delimiters)的方式使用。这样可以在使用自定义分隔符时避免影响第三方模板
14901490

14911491
{% raw %}
14921492
<div class="upgrade-path">
@@ -1497,12 +1497,12 @@ Async is now required for rendering performance.
14971497

14981498
### `Vue.config.unsafeDelimiters` <sup>弃用</sup>
14991499

1500-
HTML interpolation [替换为 `v-html`](#HTML-Interpolation-deprecated).
1500+
HTML 插入 [替换为 `v-html`](#HTML-Interpolation-deprecated).
15011501

15021502
{% raw %}
15031503
<div class="upgrade-path">
15041504
<h4>升级方式</h4>
1505-
<p>运行 <a href="https://github.com/vuejs/vue-migration-helper">migration helper</a> 工具找到 <code>Vue.config.unsafeDelimiters</code>。然后 helper 工具也会找到HTML插入的实例,可以用`v-HTML`来替换。</p>
1505+
<p>运行 <a href="https://github.com/vuejs/vue-migration-helper">migration helper</a> 工具找到 <code>Vue.config.unsafeDelimiters</code>。然后 helper 工具也会找到HTML插入的实例,可以用`v-html`来替换。</p>
15061506
</div>
15071507
{% endraw %}
15081508

0 commit comments

Comments
 (0)