Skip to content

Commit 80a0d58

Browse files
committed
Fix some text and links to the old domain
1 parent c06af93 commit 80a0d58

File tree

10 files changed

+17
-16
lines changed

10 files changed

+17
-16
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "cn.vuejs.org",
2+
"name": "v2.cn.vuejs.org",
33
"private": true,
44
"hexo": {
55
"version": "6.2.0"

src/v2/cookbook/creating-custom-scroll-directives.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ order: 7
66

77
## 基本的示例
88

9-
我们可能很多次想为网站的滚动事件添加一些行为,尤其是动画。已有的做法很多,但是代码和依赖最少的方式可能就是使用一个[自定义指令](../guide/custom-directive.html)创建一个钩子,在特定的滚动事件之后作处理。
9+
我们可能很多次想为网站的滚动事件添加一些行为,尤其是动画。已有的做法很多,但是代码和依赖最少的方式可能就是使用一个[自定义指令](/v2/guide/custom-directive.html)创建一个钩子,在特定的滚动事件之后作处理。
1010

1111
```js
1212
Vue.directive('scroll', {

src/v2/cookbook/packaging-sfc-for-npm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Vue already allows components to be written as a single file. Because a Single F
3939

4040
> "Why can't people use my `.vue` file directly? Isn't that the simplest way to share components?"
4141
42-
It's true, you can share `.vue` files directly, and anyone using a [Vue build](https://vuejs.org/v2/guide/installation.html#Explanation-of-Different-Builds) containing the Vue compiler can consume it immediately. Also, the SSR build uses string concatenation as an optimization, so the `.vue` file might be preferred in this scenario (see [Packaging Components for npm > SSR Usage](#SSR-Usage) for details). However, this excludes anyone who wishes to use the component directly in a browser via `<script>` tag, anyone who uses a runtime-only build, or build processes which don't understand what to do with `.vue` files.
42+
It's true, you can share `.vue` files directly, and anyone using a [Vue build](/v2/guide/installation.html#Explanation-of-Different-Builds) containing the Vue compiler can consume it immediately. Also, the SSR build uses string concatenation as an optimization, so the `.vue` file might be preferred in this scenario (see [Packaging Components for npm > SSR Usage](#SSR-Usage) for details). However, this excludes anyone who wishes to use the component directly in a browser via `<script>` tag, anyone who uses a runtime-only build, or build processes which don't understand what to do with `.vue` files.
4343

4444
Properly packaging your SFC for distribution via npm enables your component to be shared in a way which is ready to use everywhere!
4545

src/v2/cookbook/practical-use-of-scoped-slots.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ So far, so good. With all that done, we could continue adding the other objects
139139

140140
But, we want to use our `GoogleMapLoader` component only as a loader that prepares the map — we don’t want to render anything on it.
141141

142-
To achieve that, we need to allow the parent component that will use our `GoogleMapLoader` to access `this.google` and `this.map` that are set inside the `GoogleMapLoader` component. That’s where [scoped slots](https://v2.vuejs.org/v2/guide/components-slots.html#Scoped-Slots) really shine. Scoped slots allow us to expose the properties set in a child component to the parent component. It may sound like Inception, but bear with me one more minute as we break that down further.
142+
To achieve that, we need to allow the parent component that will use our `GoogleMapLoader` to access `this.google` and `this.map` that are set inside the `GoogleMapLoader` component. That’s where [scoped slots](/v2/guide/components-slots.html#Scoped-Slots) really shine. Scoped slots allow us to expose the properties set in a child component to the parent component. It may sound like Inception, but bear with me one more minute as we break that down further.
143143

144144
### 2. Create component that uses our initializer component.
145145

@@ -206,7 +206,7 @@ Now, when we have the slot in the child component, we need to receive and consum
206206

207207
### 4. Receive exposed props in the parent component using `slot-scope` attribute.
208208

209-
To receive the props in the parent component, we declare a template element and use the `slot-scope` attribute. This attribute has access to the object carrying all the props exposed from the child component. We can grab the whole object or we can [de-structure that object](https://v2.vuejs.org/guide/components-slots.html#Destructuring-slot-scope) and only what we need.
209+
To receive the props in the parent component, we declare a template element and use the `slot-scope` attribute. This attribute has access to the object carrying all the props exposed from the child component. We can grab the whole object or we can [de-structure that object](/v2/guide/components-slots.html#Destructuring-slot-scope) and only what we need.
210210

211211
Let’s de-structure this thing to get what we need.
212212

src/v2/examples/vue-20-todomvc/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ <h1>todos</h1>
153153
},
154154

155155
// computed properties
156-
// http://vuejs.org/guide/computed.html
156+
// http://v2.vuejs.org/guide/computed.html
157157
computed: {
158158
filteredTodos: function() {
159159
return filters[this.visibility](this.todos);
@@ -227,7 +227,7 @@ <h1>todos</h1>
227227

228228
// a custom directive to wait for the DOM to be updated
229229
// before focusing on the input field.
230-
// http://vuejs.org/guide/custom-directive.html
230+
// http://v2.vuejs.org/guide/custom-directive.html
231231
directives: {
232232
"todo-focus": function(el, binding) {
233233
if (binding.value) {

src/v2/guide/components-edge-cases.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ inject: ['getMap']
163163

164164
<p class="tip">然而,依赖注入还是有负面影响的。它将你应用程序中的组件与它们当前的组织方式耦合起来,使重构变得更加困难。同时所提供的 property 是非响应式的。这是出于设计的考虑,因为使用它们来创建一个中心化规模化的数据跟<a href="#访问根实例">使用 <code>$root</code></a>做这件事都是不够好的。如果你想要共享的这个 property 是你的应用特有的,而不是通用化的,或者如果你想在祖先组件中更新所提供的数据,那么这意味着你可能需要换用一个像 <a href="https://github.com/vuejs/vuex">Vuex</a> 这样真正的状态管理方案了。</p>
165165

166-
你可以在 [API 参考文档](https://v2.cn.vuejs.org/v2/api/#provide-inject)学习更多关于依赖注入的知识。
166+
你可以在 [API 参考文档](/v2/api/#provide-inject)学习更多关于依赖注入的知识。
167167

168168
## 程序化的事件侦听器
169169

@@ -235,7 +235,7 @@ methods: {
235235

236236
查阅[这个示例](https://codesandbox.io/s/github/vuejs/v2.vuejs.org/tree/master/src/v2/examples/vue-20-programmatic-event-listeners)可以了解到完整的代码。注意,即便如此,如果你发现自己不得不在单个组件里做很多建立和清理的工作,最好的方式通常还是创建更多的模块化组件。在这个例子中,我们推荐创建一个可复用的 `<input-datepicker>` 组件。
237237

238-
想了解更多程序化侦听器的内容,请查阅[实例方法 / 事件](https://v2.cn.vuejs.org/v2/api/#实例方法-事件)相关的 API。
238+
想了解更多程序化侦听器的内容,请查阅[实例方法 / 事件](/v2/api/#实例方法-事件)相关的 API。
239239

240240
<p class="tip">注意 Vue 的事件系统不同于浏览器的 <a href="https://developer.mozilla.org/zh-CN/docs/Web/API/EventTarget">EventTarget API</a>。尽管它们工作起来是相似的,但是 <code>$emit</code>、<code>$on</code>, 和 <code>$off</code> 并不是 <code>dispatchEvent</code>、<code>addEventListener</code> 和 <code>removeEventListener</code> 的别名。</p>
241241

@@ -363,7 +363,7 @@ x-template 需要定义在 Vue 所属的 DOM 元素外。
363363

364364
<p class="tip">如果你发现你自己需要在 Vue 中做一次强制更新,99.9% 的情况,是你在某个地方做错了事。</p>
365365

366-
你可能还没有留意到[数组](https://v2.cn.vuejs.org/v2/guide/list.html#注意事项)[对象](https://v2.cn.vuejs.org/v2/guide/list.html#对象变更检测注意事项)的变更检测注意事项,或者你可能依赖了一个未被 Vue 的响应式系统追踪的状态。
366+
你可能还没有留意到[数组](/v2/guide/list.html#注意事项)[对象](/v2/guide/list.html#对象变更检测注意事项)的变更检测注意事项,或者你可能依赖了一个未被 Vue 的响应式系统追踪的状态。
367367

368368
然而,如果你已经做到了上述的事项仍然发现在极少数的情况下需要手动强制更新,那么你可以通过 [`$forceUpdate`](../api/#vm-forceUpdate) 来做这件事。
369369

src/v2/guide/list.md

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

238238
<p class="tip">不要使用对象或数组之类的非基本类型值作为 `v-for` 的 `key`。请用字符串或数值类型的值。</p>
239239

240-
更多 `key` attribute 的细节用法请移步至 [`key` 的 API 文档](https://v2.cn.vuejs.org/v2/api/#key)
240+
更多 `key` attribute 的细节用法请移步至 [`key` 的 API 文档](/v2/api/#key)
241241

242242
## 数组更新检测
243243

src/v2/guide/reactivity.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Vue.set(vm.items, indexOfItem, newValue)
8888
vm.items.splice(indexOfItem, 1, newValue)
8989
```
9090

91-
你也可以使用 [`vm.$set`](https://v2.cn.vuejs.org/v2/api/#vm-set) 实例方法,该方法是全局方法 `Vue.set` 的一个别名:
91+
你也可以使用 [`vm.$set`](/v2/api/#vm-set) 实例方法,该方法是全局方法 `Vue.set` 的一个别名:
9292

9393
``` js
9494
vm.$set(vm.items, indexOfItem, newValue)

src/v2/guide/testing.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,15 @@ Vue Testing Library 是一组专注于测试组件而不依赖实现细节的工
8888

8989
- [Vue Testing Library 官网](https://testing-library.com/docs/vue-testing-library/intro)
9090

91-
#### Vue Test Utils
91+
#### Vue Test Utils
9292

9393
Vue Test Utils 是官方的偏底层的组件测试库,它是为用户提供对 Vue 特定 API 的访问而编写的。如果你对测试 Vue 应用不熟悉,我们建议你使用 Vue Testing Library,它是 Vue Test Utils 的抽象。
9494

9595
**资源:**
9696

9797
- [Vue Test Utils 官方文档](https://vue-test-utils.vuejs.org)
9898
- [Vue 测试指南](https://lmiller1990.github.io/vue-testing-handbook/zh-CN/) by Lachlan Miller
99+
- [Cookbook:Vue 组件的单元测试](/v2/cookbook/unit-testing-vue-components.html)
99100

100101
## 端到端 (E2E) 测试
101102

src/v2/style-guide/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ new Vue({
192192
</summary>
193193
{% endraw %}
194194

195-
细致的 [prop 定义](../guide/components-props.html#Prop-验证)有两个好处:
195+
细致的 [prop 定义](/v2/guide/components-props.html#Prop-验证)有两个好处:
196196

197197
- 它们写明了组件的 API,所以很容易看懂组件的用法;
198198
- 在开发环境下,如果向一个组件提供格式不正确的 prop,Vue 将会告警,以帮助你捕获潜在的错误来源。
@@ -1980,9 +1980,9 @@ Vue.component('TodoItem', {
19801980

19811981
**应该优先通过 [Vuex](https://github.com/vuejs/vuex) 管理全局状态,而不是通过 `this.$root` 或一个全局事件总线。**
19821982

1983-
通过 `this.$root` 和/或[全局事件总线](../guide/migration.html#dispatch-和-broadcast-替换)管理状态在很多简单的情况下都是很方便的,但是并不适用于绝大多数的应用。
1983+
通过 `this.$root` 和/或[全局事件总线](/v2/guide/migration.html#dispatch-和-broadcast-替换)管理状态在很多简单的情况下都是很方便的,但是并不适用于绝大多数的应用。
19841984

1985-
Vuex 是 Vue 的[官方类 flux 实现](../guide/state-management.html#类-Flux-状态管理的官方实现),其提供的不仅是一个管理状态的中心区域,还是组织、追踪和调试状态变更的好工具。它很好地集成在了 Vue 生态系统之中 (包括完整的 [Vue DevTools](../guide/installation.html#Vue-Devtools) 支持)。
1985+
Vuex 是 Vue 的[官方类 flux 实现](/v2/guide/state-management.html#类-Flux-状态管理的官方实现),其提供的不仅是一个管理状态的中心区域,还是组织、追踪和调试状态变更的好工具。它很好地集成在了 Vue 生态系统之中 (包括完整的 [Vue DevTools](/v2/guide/installation.html#Vue-Devtools) 支持)。
19861986

19871987
{% raw %}</details>{% endraw %}
19881988

0 commit comments

Comments
 (0)