Skip to content

Commit

Permalink
fix: cn.vuejs.org -> v2.cn.vuejs.org
Browse files Browse the repository at this point in the history
  • Loading branch information
Adashuai5 committed Aug 31, 2022
1 parent 59de81d commit a3f1924
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 27 deletions.
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ $ pnpm start # 开发服务器地址为 http://localhost:4000
* 发 issue 讨论译法或书写格式
* 发 issue 讨论部署或协作流程上的问题

<!-- TODO: update when v3 becomes the main docsite -->
有劳在翻译之前移步 [wiki](https://github.com/vuejs/cn.vuejs.org/wiki) 了解相关注意事项。
有劳在翻译之前移步 [wiki](https://github.com/vuejs/v2.cn.vuejs.org/wiki) 了解相关注意事项。

**注意:**

Expand All @@ -38,10 +37,8 @@ $ pnpm start # 开发服务器地址为 http://localhost:4000

## 致谢

<!-- TODO: update when v3 becomes the main docsite -->
网站在创立之初得到了很多朋友们的帮助,大家一起分工协作完成了整站的翻译工作。[这个页面](https://cn.vuejs.org/about/)集中记录了大家这段时期的努力和付出,以表谢意!
网站在创立之初得到了很多朋友们的帮助,大家一起分工协作完成了整站的翻译工作。[这个页面](https://v2.cn.vuejs.org/about/)集中记录了大家这段时期的努力和付出,以表谢意!

**感谢所有参与翻译的朋友们!**

<!-- TODO: update when v3 becomes the main docsite -->
目前网站已处于维护状态,最新的文档/翻译贡献情况可以参阅 GitHub 提供的 [contributors](https://github.com/vuejs/cn.vuejs.org/graphs/contributors) 页面。
目前网站已处于维护状态,最新的文档/翻译贡献情况可以参阅 GitHub 提供的 [contributors](https://github.com/vuejs/v2.cn.vuejs.org/graphs/contributors) 页面。
6 changes: 2 additions & 4 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ language: zh-CN

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
# TODO: update when v3 becomes the main docsite
url: https://cn.vuejs.org
url: https://v2.cn.vuejs.org
root: /
permalink: :year/:month/:day/:title/
tag_dir: tags
Expand Down Expand Up @@ -146,8 +145,7 @@ markdown:
## Docs: https://hexo.io/docs/one-command-deployment
deploy:
type: git
# TODO: update when v3 becomes the main docsite
repository: [email protected]:vuejs/cn.vuejs.org.git
repository: [email protected]:vuejs/v2.cn.vuejs.org.git
branch: gh-pages

feed:
Expand Down
9 changes: 3 additions & 6 deletions src/v2/guide/components-edge-cases.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ inject: ['getMap']

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

<!-- TODO: update when v3 becomes the main docsite -->
你可以在 [API 参考文档](https://cn.vuejs.org/v2/api/#provide-inject)学习更多关于依赖注入的知识。
你可以在 [API 参考文档](https://v2.cn.vuejs.org/v2/api/#provide-inject)学习更多关于依赖注入的知识。

## 程序化的事件侦听器

Expand Down Expand Up @@ -236,8 +235,7 @@ methods: {

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

<!-- TODO: update when v3 becomes the main docsite -->
想了解更多程序化侦听器的内容,请查阅[实例方法 / 事件](https://cn.vuejs.org/v2/api/#实例方法-事件)相关的 API。
想了解更多程序化侦听器的内容,请查阅[实例方法 / 事件](https://v2.cn.vuejs.org/v2/api/#实例方法-事件)相关的 API。

<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>

Expand Down Expand Up @@ -365,8 +363,7 @@ x-template 需要定义在 Vue 所属的 DOM 元素外。

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

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

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

Expand Down
1 change: 0 additions & 1 deletion src/v2/guide/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ Vue 在其所有项目中公布的功能和行为都遵循[语义化版本控制

<p class="tip">在开发环境下不要使用压缩版本,不然你就失去了所有常见错误相关的警告!</p>

<!-- TODO: update when v3 becomes the main docsite -->
<div id="downloads">
<a class="button" href="https://v2.cn.vuejs.org/js/vue.js" download>开发版本</a><span class="light info">包含完整的警告和调试模式</span>

Expand Down
3 changes: 1 addition & 2 deletions src/v2/guide/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,7 @@ new Vue({

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

<!-- TODO: update when v3 becomes the main docsite -->
更多 `key` attribute 的细节用法请移步至 [`key` 的 API 文档](https://cn.vuejs.org/v2/api/#key)
更多 `key` attribute 的细节用法请移步至 [`key` 的 API 文档](https://v2.cn.vuejs.org/v2/api/#key)

## 数组更新检测

Expand Down
3 changes: 1 addition & 2 deletions src/v2/guide/reactivity.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ Vue.set(vm.items, indexOfItem, newValue)
vm.items.splice(indexOfItem, 1, newValue)
```

<!-- TODO: update when v3 becomes the main docsite -->
你也可以使用 [`vm.$set`](https://cn.vuejs.org/v2/api/#vm-set) 实例方法,该方法是全局方法 `Vue.set` 的一个别名:
你也可以使用 [`vm.$set`](https://v2.cn.vuejs.org/v2/api/#vm-set) 实例方法,该方法是全局方法 `Vue.set` 的一个别名:

``` js
vm.$set(vm.items, indexOfItem, newValue)
Expand Down
1 change: 0 additions & 1 deletion themes/vue/layout/layout.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<meta name="description" content="<%- theme.site_description %>">
<meta name="viewport" content="width=device-width, initial-scale=1">

<!-- TODO: update when v3 becomes the main docsite -->
<link rel="alternate" hreflang="x-default" href="https://v2.vuejs.org/<%- page.path %>">
<link rel="alternate" hreflang="zh" href="https://v2.cn.vuejs.org/<%- page.path %>">
<link rel="alternate" hreflang="ja" href="https://jp.vuejs.org/<%- page.path %>">
Expand Down
3 changes: 1 addition & 2 deletions themes/vue/layout/page.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@
<%- partial('partials/ad-text') %>
<%_ } _%>
发现错误?想参与编辑?
<!-- TODO: update when v3 becomes the main docsite -->
<a href="https://github.com/vuejs/cn.vuejs.org/blob/master/src/<%- page.path.replace(/\.html$/, '.md') %>" rel="noopener" target="_blank">
<a href="https://github.com/vuejs/v2.cn.vuejs.org/blob/master/src/<%- page.path.replace(/\.html$/, '.md') %>" rel="noopener" target="_blank">
在 GitHub 上编辑此页!
</a>
<!-- Deployed on
Expand Down
1 change: 0 additions & 1 deletion themes/vue/layout/partials/header.ejs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<div>
<div id="v3-banner">
<!-- TODO: update when v3 becomes the main docsite -->
<span class="hidden-sm">您在浏览的是 v2.x 及更早版本的文档。</span
>v3.x 的文档<a href="https://v3.cn.vuejs.org/">在这里</a>。
</div>
Expand Down
3 changes: 1 addition & 2 deletions themes/vue/layout/partials/main_menu.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@
<%- partial('partials/support_vue_dropdown') %>
<%- partial('partials/language_dropdown') %>
<!-- start: special logic for cn -->
<!-- TODO: update when v3 becomes the main docsite -->
<li><a href="https://github.com/vuejs/cn.vuejs.org/" target="_blank" class="nav-link contribute">参与翻译</a></li>
<li><a href="https://github.com/vuejs/v2.cn.vuejs.org/" target="_blank" class="nav-link contribute">参与翻译</a></li>
<!-- end: special logic for cn -->

0 comments on commit a3f1924

Please sign in to comment.