Skip to content

Commit 98c48d1

Browse files
authored
Merge pull request #126 from menpuji/2.0-cn
路由/单元测试 校验
2 parents f252743 + 3b1b963 commit 98c48d1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/guide/routing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ new Vue({
3939

4040
## 整合第三方路由
4141

42-
如果有非常喜欢的第三方路由,如[Page.js](https://github.com/visionmedia/page.js)或者 [Director](https://github.com/flatiron/director), 整合[很简单](https://github.com/chrisvfritz/vue-2.0-simple-routing-example/compare/master...pagejs). 这有个 [复杂示例](https://github.com/chrisvfritz/vue-2.0-simple-routing-example/tree/pagejs) 用了Page.js.
42+
如果有非常喜欢的第三方路由,如[Page.js](https://github.com/visionmedia/page.js)或者 [Director](https://github.com/flatiron/director), 整合[很简单](https://github.com/chrisvfritz/vue-2.0-simple-routing-example/compare/master...pagejs)。 这有个用了Page.js的[复杂示例](https://github.com/chrisvfritz/vue-2.0-simple-routing-example/tree/pagejs)
4343

4444
***
4545

src/guide/unit-testing.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ describe('MyComponent', () => {
9090
import Vue from 'vue'
9191
import MyComponent from './MyComponent.vue'
9292

93-
// helper function that mounts and returns the rendered text
93+
// 挂载元素并返回已渲染的文本的工具函数
9494
function getRenderedText (Component, propsData) {
9595
const Ctor = Vue.extend(Component)
9696
const vm = new Ctor({ propsData }).$mount()
@@ -112,15 +112,15 @@ describe('MyComponent', () => {
112112

113113
## 主张异步更新
114114

115-
由于Vue进行[异步更新DOM]((/guide/reactivity.html#Async-Update-Queue))的情况,一些断言必须在` Vue nexttick `回调中进行:
115+
由于Vue进行[异步更新DOM](/guide/reactivity.html#Async-Update-Queue)的情况,一些依赖DOM更新结果的断言必须在` Vue nexttick `回调中进行:
116116

117117
``` js
118118
// 在状态更新后检查生成的HTML
119119
it('updates the rendered message when vm.message updates', done => {
120120
const vm = new Vue(MyComponent).$mount()
121121
vm.message = 'foo'
122122

123-
// wait a "tick" after state change before asserting DOM updates
123+
// 在状态改变后和断言DOM更新前等待一刻
124124
Vue.nextTick(() => {
125125
expect(vm.$el.textContent).toBe('foo')
126126
done()

0 commit comments

Comments
 (0)