Skip to content

Commit 7a1563d

Browse files
phananJustineo
authored andcommitted
More fixes for %raw% tags showing (#2005)
1 parent 2b4c195 commit 7a1563d

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

src/v2/guide/migration-vue-router.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,9 @@ router.alias({
212212

213213
如果你需要进行多次 alias 操作,你也可以使用一个数组语法去实现:
214214

215-
``` js
215+
{% codeblock lang:js %}
216216
alias: ['/manage', '/administer', '/administrate']
217-
```
217+
{% endcodeblock %}
218218

219219
{% raw %}
220220
<div class="upgrade-path">

src/v2/guide/migration.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -209,15 +209,15 @@ mounted: function () {
209209

210210
`track-by` 已经替换为 `key`,它的工作方式与其他属性一样,没有 `v-bind` 或者 `:` 前缀,它会被作为一个字符串处理。多数情况下,你需要使用具有完整表达式的动态绑定 (dynamic binding) 来替换静态的 key。例如,替换:
211211

212-
``` html
212+
{% codeblock lang:html %}
213213
<div v-for="item in items" track-by="id">
214-
```
214+
{% endcodeblock %}
215215

216216
你现在应该写为:
217217

218-
``` html
218+
{% codeblock lang:html %}
219219
<div v-for="item in items" v-bind:key="item.id">
220-
```
220+
{% endcodeblock %}
221221

222222
{% raw %}
223223
<div class="upgrade-path">
@@ -399,9 +399,9 @@ methods: {
399399

400400
现在在组件上使用 `v-on` 只会监听自定义事件 (组件用 `$emit` 触发的事件)。如果要监听根元素的原生事件,可以使用 `.native` 修饰符,比如:
401401

402-
``` html
402+
{% codeblock lang:html %}
403403
<my-component v-on:click.native="doSomething"></my-component>
404-
```
404+
{% endcodeblock %}
405405

406406
{% raw %}
407407
<div class="upgrade-path">
@@ -600,9 +600,9 @@ strings.map(function (str) {
600600

601601
替代方案是,你可以使用对象数组,这样`v-model` 就可以同步更新对象里面的字段了,例如:
602602

603-
``` html
603+
{% codeblock lang:html %}
604604
<input v-for="obj in objects" v-model="obj.str">
605-
```
605+
{% endcodeblock %}
606606

607607
{% raw %}
608608
<div class="upgrade-path">
@@ -706,7 +706,7 @@ strings.map(function (str) {
706706

707707
示例,如下更改:
708708

709-
``` js
709+
``` html
710710
<p v-my-directive.literal="foo bar baz"></p>
711711
```
712712

@@ -989,9 +989,9 @@ computed: {
989989

990990
甚至可以字段排序:
991991

992-
``` js
992+
{% codeblock lang:js %}
993993
_.orderBy(this.users, ['name', 'last_login'], ['asc', 'desc'])
994-
```
994+
{% endcodeblock %}
995995

996996
{% raw %}
997997
<div class="upgrade-path">
@@ -1069,9 +1069,9 @@ function pluralizeKnife (count) {
10691069

10701070
对于简单的问题,可以这样做:
10711071

1072-
``` js
1072+
{% codeblock lang:js %}
10731073
'$' + price.toFixed(2)
1074-
```
1074+
{% endcodeblock %}
10751075

10761076
大多数情况下,仍然会有奇怪的现象 (比如 `0.035.toFixed(2)` 向上取舍得到 `0.04`,但是 `0.045` 向下取舍却也得到 `0.04`)。解决这些问题可以使用 [`accounting`](https://openexchangerates.github.io/accounting.js/) 库来实现更多可靠的货币格式化。
10771077

@@ -1364,9 +1364,9 @@ methods: {
13641364

13651365
使用 DOM 原生方法:
13661366

1367-
``` js
1367+
{% codeblock lang:js %}
13681368
myElement.appendChild(vm.$el)
1369-
```
1369+
{% endcodeblock %}
13701370

13711371
{% raw %}
13721372
<div class="upgrade-path">
@@ -1379,9 +1379,9 @@ myElement.appendChild(vm.$el)
13791379

13801380
使用 DOM 原生方法:
13811381

1382-
``` js
1382+
{% codeblock lang:js %}
13831383
myElement.parentNode.insertBefore(vm.$el, myElement)
1384-
```
1384+
{% endcodeblock %}
13851385

13861386
{% raw %}
13871387
<div class="upgrade-path">
@@ -1394,15 +1394,15 @@ myElement.parentNode.insertBefore(vm.$el, myElement)
13941394

13951395
使用 DOM 原生方法:
13961396

1397-
``` js
1397+
{% codeblock lang:js %}
13981398
myElement.parentNode.insertBefore(vm.$el, myElement.nextSibling)
1399-
```
1399+
{% endcodeblock %}
14001400

14011401
如果 `myElement` 是最后一个节点也可以这样写:
14021402

1403-
``` js
1403+
{% codeblock lang:js %}
14041404
myElement.parentNode.appendChild(vm.$el)
1405-
```
1405+
{% endcodeblock %}
14061406

14071407
{% raw %}
14081408
<div class="upgrade-path">
@@ -1415,9 +1415,9 @@ myElement.parentNode.appendChild(vm.$el)
14151415

14161416
使用 DOM 原生方法:
14171417

1418-
``` js
1418+
{% codeblock lang:js %}
14191419
vm.$el.remove()
1420-
```
1420+
{% endcodeblock %}
14211421

14221422
{% raw %}
14231423
<div class="upgrade-path">

0 commit comments

Comments
 (0)