Skip to content

Commit 0f0a135

Browse files
committed
Merge commit '9d5c0295ecf3f0c913b9d198f3f9b653f02ae8ab' into 2.0-cn
* commit '9d5c0295ecf3f0c913b9d198f3f9b653f02ae8ab': fix support page mobile sidebar tweak mobile update runtime build info tweak position responsive css redesign homepage 2.0.0-rc.8 update makefile update src links Update index.md (vuejs#421) # Conflicts: # src/guide/index.md # src/guide/installation.md # themes/vue/_config.yml # themes/vue/layout/index.ejs # themes/vue/layout/layout.ejs # themes/vue/layout/partials/header.ejs # themes/vue/layout/partials/main_menu.ejs # themes/vue/layout/partials/sponsors.ejs # themes/vue/source/css/page.styl
2 parents e75b4ae + 8746b1b commit 0f0a135

33 files changed

+775
-2228
lines changed

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@ all: update deploy
33
deploy:
44
rm -f db.json
55
hexo generate
6-
cp -R ./todomvc public/examples
76
hexo deploy
87

98
update:
109
cd ../vue && \
1110
git checkout -- dist && \
12-
git checkout next && \
11+
git checkout dev && \
1312
npm run build
1413
cp ../vue/dist/vue.min.js themes/vue/source/js/vue.min.js
1514
cp ../vue/dist/vue.js themes/vue/source/js/vue.js

src/api/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1780,8 +1780,8 @@ type: api
17801780

17811781
## VNode Interface
17821782

1783-
- Please refer to the [VNode class declaration](https://github.com/vuejs/vue/blob/next/src/core/vdom/vnode.js).
1783+
- Please refer to the [VNode class declaration](https://github.com/vuejs/vue/blob/dev/src/core/vdom/vnode.js).
17841784

17851785
## Server-Side Rendering
17861786

1787-
- Please refer to the [vue-server-renderer package documentation](https://github.com/vuejs/vue/tree/next/packages/vue-server-renderer).
1787+
- Please refer to the [vue-server-renderer package documentation](https://github.com/vuejs/vue/tree/dev/packages/vue-server-renderer).

src/blog/index.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/guide/comparison.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ React is renowned for its steep learning curve. Before you can really get starte
213213
While Vue scales up just as well as, if not better than React, it also scales down just as well as jQuery. That's right - all you have to do is drop a single script tag into a page:
214214

215215
``` html
216-
<script src="https://unpkg.com/vue@next/dist/vue.js"></script>
216+
<script src="https://unpkg.com/vue/dist/vue.js"></script>
217217
```
218218

219219
Then you can start writing Vue code and even ship the minified version to production without feeling guilty or having to worry about performance problems.
@@ -268,7 +268,7 @@ We have a separate section for Angular 2 because it really is a completely new f
268268

269269
While Angular 1 could be used for smaller applications, Angular 2 has shifted focus to best facilitate large enterprise applications. As part of this, it almost requires TypeScript, which can be very useful for developers that desire the type safety of languages such as Java and C#.
270270

271-
Vue is also well-suited to [enterprise environments](https://github.com/vuejs/awesome-vue#enterprise-usage) and can even be used with TypeScript via our [official typings](https://github.com/vuejs/vue/tree/next/types) and [user-contributed decorators](https://github.com/itsFrank/vue-typescript), though it's definitely optional in our case.
271+
Vue is also well-suited to [enterprise environments](https://github.com/vuejs/awesome-vue#enterprise-usage) and can even be used with TypeScript via our [official typings](https://github.com/vuejs/vue/tree/dev/types) and [user-contributed decorators](https://github.com/itsFrank/vue-typescript), though it's definitely optional in our case.
272272

273273
### Size and Performance
274274

src/guide/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,8 @@ var app7 = new Vue({
346346

347347
1.Web 组件规范仍然远未完成,并且没有浏览器实现。相比之下,Vue.js 组件不需要任何补丁,并且在所有支持的浏览器(IE9 及更高版本)之下表现一致。必要时,Vue.js 组件也可以放在原生自定义元素之内。
348348

349-
2.Vue.js 组件提供了原生自定义元素所不具备的一些重要功能,比如组件间的数据流,自定义事件系统,以及动态的、带特效的组件替换。
349+
2.Vue.js 组件提供了原生自定义元素所不具备的一些重要功能,比如组件间的数据流,自定义事件系统,以及构建工具的继承。
350+
350351

351352
## 准备好了吗?
352353

src/guide/installation.md

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
title: 安装
33
type: guide
44
order: 1
5-
vue_version: 2.0.0-rc.7
6-
dev_size: "184"
7-
min_size: "64"
8-
gz_size: "22"
5+
vue_version: 2.0.0-rc.8
6+
dev_size: "183.80"
7+
min_size: "61.54"
8+
gz_size: "22.53"
99
---
1010

1111
### 兼容性
@@ -30,43 +30,46 @@ Vue.js 不支持 IE8 及其以下版本,因为 Vue.js 使用了 IE8 不能实
3030

3131
### CDN
3232

33-
可以从 [jsdelivr](http://cdn.jsdelivr.net/vue/2.0.0-rc.1/vue.min.js)[cdnjs](http://cdnjs.cloudflare.com/ajax/libs/vue/2.0.0-rc.1/vue.min.js) 获取(版本更新可能略滞后)。
33+
Recommended: [unpkg](https://unpkg.com/vue), which will reflect the latest version as soon as it is published to npm. You can also browse the source of the npm package at [unpkg.com/vue/](https://unpkg.com/vue/).
3434

35-
### CSP 兼容版本
36-
37-
可以在 [unpkg](https://unpkg.com/vue/dist/vue.min.js) 获取,会和npm一样保持最新版本,也可以在[unpkg.com/vue/](https://unpkg.com/vue/)浏览npm包资源。
38-
39-
有些环境,如 Google Chrome Apps,强制应用内容安全策略 (CSP) ,不能使用 `new Function()` 对表达式求值。独立构建编译模板时依赖这个特性,所以不能在这类环境下使用。
40-
41-
然而,有个解决方案,当用webpack+vue-loader或者Browserify+vueify构建vue应用时,你的模板将被编译进`render`函数实现完美运作在CSP环境中。
35+
Also available on [jsdelivr](//cdn.jsdelivr.net/vue/{{vue_version}}/vue.js) or [cdnjs](//cdnjs.cloudflare.com/ajax/libs/vue/{{vue_version}}/vue.js), but these two services take some time to sync so the latest release may not be available yet.
4236

4337
## NPM
4438

4539
在用 Vue.js 构建大型应用时推荐使用 NPM 安装,NPM 能很好地和诸如 [Webpack](http://webpack.github.io/)[Browserify](http://browserify.org/) 的 CommonJS 模块打包器配合使用。Vue.js 也提供配套工具来开发[单文件组件](application.html#单文件组件)
4640

4741
``` bash
4842
# 最新稳定版
49-
$ npm install vue@next
43+
$ npm install vue
5044
```
5145

52-
### 用 npm 构建时注意
46+
### Standalone vs. Runtime-only Build
47+
48+
There are two builds available, the standalone build and the runtime-only build.
5349

50+
- The standalone build includes the compiler and supports the `template` option.
5451

55-
由于在构建时单个组件预编译模板进入渲染函数,所以默认导出的`vue` npm 包是 **只在运行环境下使用的**,它不支持`template`选项。如你希望使用`template`选项,你需要配置你的构建工具软连接`vue`单独构建。
52+
- The runtime-only build does not include the template compiler, and does not support the `template` option. You can only use the `render` option when using the runtime-only build, but it works with single-file components, because single-file components' templates are pre-compiled into `render` functions during the build step. The runtime-only build is roughly 30% lighter-weight than the standalone build, weighing only 16kb min+gzip.
5653

57-
用webpack,添加下面的配置:
54+
By default, the NPM package exports the standalone build. To use the runtime-only build, add the following alias to your webpack config:
5855

5956
``` js
6057
resolve: {
6158
alias: {
62-
vue: 'vue/dist/vue.js'
59+
vue: 'vue/dist/vue.common.js'
6360
}
6461
}
6562
```
6663

6764
对于Browserify,可以用 [aliasify](https://github.com/benbria/aliasify)
6865

69-
<p class="tip">不要用`import Vue from 'vue/dist/vue` - 因为一些工具或第三方库可能z正常引入vue,这样做可能导致应用程序运行时和独立的构建导致错误。</p>
66+
<p class="tip">Do NOT do `import Vue from 'vue/dist/vue.common.js'` - since some tools or 3rd party libraries may import vue as well, this may cause the app to load both the runtime and standalone builds at the same time and lead to errors.</p>
67+
68+
### CSP environments
69+
70+
Some environments, such as Google Chrome Apps, enforce Content Security Policy (CSP), which prohibits the use of `new Function()` for evaluating expressions. The standalone build depends on this feature to compile templates, so is unusable in these environments.
71+
72+
On the other hand, the runtime-only build is fully CSP-compliant. When using the runtime-only build with [Webpack + vue-loader](https://github.com/vuejs-templates/webpack-simple-2.0) or [Browserify + vueify](https://github.com/vuejs-templates/browserify-simple-2.0), your templates will be precompiled into `render` functions which work perfectly in CSP environments.
7073

7174
## 命令行工具
7275

@@ -86,12 +89,11 @@ $ npm run dev
8689

8790
## 开发版本
8891

89-
**重要**:发布到 NPM 上的 CommonJS 包 (`vue.common.js`) 只在发布新版本时签入 `next` 分支,想使用 GitHub 上最新的源码,需要自己编译:
92+
**Important**: the built files in GitHub's `/dist` folder are only checked-in during releases. To use Vue from the latest source code on GitHub, you will have to build it yourself!
9093

9194
``` bash
9295
git clone https://github.com/vuejs/vue.git node_modules/vue
9396
cd node_modules/vue
94-
git checkout next
9597
npm install
9698
npm run build
9799
```
@@ -100,7 +102,7 @@ npm run build
100102

101103
``` bash
102104
# 最新稳定版本
103-
$ bower install vue#next
105+
$ bower install vue
104106
```
105107

106108
## AMD 模块加载器

src/guide/single-file-components.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,25 @@ NODE_ENV=production browserify -g envify -e main.js | uglifyjs -c -m > build.js
9999
``` bash
100100
NODE_ENV=production browserify -g envify -p [ vueify/plugins/extract-css -o build.css ] -e main.js | uglifyjs -c -m > build.js
101101
```
102+
103+
### Use the Runtime-Only Build
104+
105+
There are two builds available, the standalone build and the runtime-only build.
106+
107+
- The standalone build includes the compiler and supports the `template` option.
108+
109+
- The runtime-only build does not include the template compiler, and does not support the `template` option. You can only use the `render` option when using the runtime-only build, but it works with single-file components, because single-file components' templates are pre-compiled into `render` functions during the build step. The runtime-only build is roughly 30% lighter-weight than the standalone build, weighing only 16kb min+gzip.
110+
111+
By default, the NPM package exports the standalone build. To use the runtime-only build, add the following alias to your webpack config:
112+
113+
``` js
114+
resolve: {
115+
alias: {
116+
vue: 'vue/dist/vue.common.js'
117+
}
118+
}
119+
```
120+
121+
For Browserify, you can use [aliasify](https://github.com/benbria/aliasify) to achieve the same.
122+
123+
<p class="tip">Do NOT do `import Vue from 'vue/dist/vue.common.js'` - since some tools or 3rd party libraries may import vue as well, this may cause the app to load both the runtime and standalone builds at the same time and lead to errors.</p>

src/guide/state-management.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ order: 21
66

77
## Official Flux-Like Implementation
88

9-
Large applications can often grow in complexity, due to multiple pieces of state scattered across many components and the interactions between them. To solve this problem, Vue offers [vuex](https://github.com/vuejs/vuex/tree/next): our own Elm-inspired state management library. It even integrates into [vue-devtools](https://github.com/vuejs/vue-devtools), providing zero-setup access to time travel.
9+
Large applications can often grow in complexity, due to multiple pieces of state scattered across many components and the interactions between them. To solve this problem, Vue offers [vuex](https://github.com/vuejs/vuex): our own Elm-inspired state management library. It even integrates into [vue-devtools](https://github.com/vuejs/vue-devtools), providing zero-setup access to time travel.
1010

1111
### Information for React Developers
1212

@@ -75,4 +75,4 @@ var vmB = new Vue({
7575

7676
As we continue developing the convention where components are never allowed to directly mutate state that belongs to a store, but should instead dispatch events that notify the store to perform actions, we eventually arrive at the [Flux](https://facebook.github.io/flux/) architecture. The benefit of this convention is we can record all state mutations happening to the store and implement advanced debugging helpers such as mutation logs, snapshots, and history re-rolls / time travel.
7777

78-
This brings us full circle back to [vuex](https://github.com/vuejs/vuex/tree/next), so if you've read this far it's probably time to try it out!
78+
This brings us full circle back to [vuex](https://github.com/vuejs/vuex), so if you've read this far it's probably time to try it out!

src/support-vuejs/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
<img src="/images/monterail.png">
3737
</a><a href="https://www.trisoft.ro/" target="_blank">
3838
<img src="/images/trisoft.png">
39+
</a><a href="http://actualize.co" target="_blank" style="width:180px">
40+
<img src="/images/actualize.png" style="width:180px">
3941
</a>
4042
</p>
4143

themes/vue/_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
google_analytics: UA-46852172-1
22
root_domain: vuefe.cn
33
vue_version: 2.0.0-rc.7
4+
vue_version: 2.0.0-rc.8

themes/vue/layout/index.ejs

Lines changed: 54 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<div class="sidebar">
2+
<ul class="main-menu">
3+
<%- partial('partials/main_menu', { context: 'sidebar' }) %>
4+
</ul>
5+
</div>
6+
17
<div id="hero">
28
<div class="inner">
39
<ul id="nav">
@@ -37,9 +43,19 @@
3743
<li class="delimiter">|</li>
3844
<li><a href="http://it.vuejs.org" class="nav-link">Italiano</a></li>
3945
</ul>
46+
<div class="left">
47+
<img class="hero-logo" src="/images/logo.png">
48+
</div><div class="right">
49+
<h2 class="vue">Vue.js</h2>
50+
<h1>
51+
The Progressive<br>JavaScript Framework
52+
</h1>
53+
<p>
54+
<a class="button" href="/guide/">GET STARTED</a>
55+
<a class="button white" href="https://github.com/vuejs/vue" target="_blank">GITHUB</a>
56+
</p>
57+
</div>
4058
</div>
41-
42-
<div class="down"><img src="/images/down.png"></div>
4359
</div>
4460

4561
<div id="sponsors-mobile">
@@ -77,22 +93,26 @@
7793
})
7894
</pre></td></tr></tbody></table></figure>
7995
</div>
96+
<div id="highlights">
97+
<div class="inner">
98+
<div class="point">
99+
<h2>Performant</h2>
100+
<p>
101+
16kb min+gzip Runtime<br>
102+
Blazing Fast Virtual DOM<br>
103+
Minimal Optimization Efforts
104+
</p>
105+
</div>
80106

81-
<div class="sign">=</div>
107+
<div class="point">
108+
<h2>Versatile</h2>
109+
<p>Lean, minimal core with a feature-rich, incrementally adoptable ecosystem.</p>
110+
</div>
82111

83-
<div class="block result">
84-
<div id="demo">
85-
<p>{{message}}</p>
86-
<input v-model="message">
112+
<div class="point">
113+
<h2>Approachable</h2>
114+
<p>Already know HTML, CSS and JavaScript? Read the guide and start building things in no time!</p>
87115
</div>
88-
<script>
89-
var demo = new Vue({
90-
el: '#demo',
91-
data: {
92-
message: 'Hello Vue.js!'
93-
}
94-
})
95-
</script>
96116
</div>
97117
</div>
98118
<div id="features">
@@ -139,3 +159,22 @@
139159
<p>Copyright (c) <%- date(Date.now(), 'YYYY') %> <a href="http://evanyou.me" target="_blank">Evan You</a></p>
140160
</div>
141161

162+
=======
163+
164+
<div id="sponsors">
165+
<div class="inner">
166+
<h3>PROUDLY SPONSORED BY</h3>
167+
<%- partial('partials/sponsors') %>
168+
<br>
169+
<a class="become-sponsor button white" href="/support-vuejs/">Become a Backer</a>
170+
</div>
171+
</div>
172+
173+
<div id="footer">
174+
Released under the <a href="https://opensource.org/licenses/MIT" href="_blank">MIT License</a><br>
175+
Copyright &copy; 2014-<%- new Date().getFullYear() %> Evan You
176+
</div>
177+
178+
<script src="//cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script>
179+
<script src="/js/common.js"></script>
180+
>>>>>>> 9d5c0295ecf3f0c913b9d198f3f9b653f02ae8ab

themes/vue/layout/layout.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
<a class="menu-button"></a>
2020
<a class="logo" href="/"></a>
2121
</div>
22+
<%- partial('partials/header') %>
2223
<% if (!isIndex) { %>
23-
<%- partial('partials/header') %>
2424
<div id="main">
2525
<% if (page.blog_index) { %>
2626
<%- partial('partials/blog') %>

themes/vue/layout/page.ejs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<% if (page.type) { %>
22
<%- partial('partials/sidebar', { type: page.type, index: page.index }) %>
3+
<% } else { %>
4+
<div class="sidebar">
5+
<ul class="main-menu">
6+
<%- partial('partials/main_menu', { context: 'sidebar' }) %>
7+
</ul>
8+
</div>
39
<% } %>
410
<div class="content <%- page.type ? page.type + ' with-sidebar' : '' %> <%- page.type === 'guide' ? page.path.replace(/.+\//, '').replace('.html', '') + '-guide' : '' %>">
511
<%- partial('partials/ad') %>

themes/vue/layout/partials/blog.ejs

Lines changed: 0 additions & 21 deletions
This file was deleted.

themes/vue/layout/partials/header.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div id="header">
22
<a id="logo" href="/">
33
<img src="/images/logo.png">
4-
<span>Vue.js <sup>2.0 RC</sup></span>
4+
<span>Vue.js</span>
55
</a>
66
<span style="
77
position: absolute;

themes/vue/source/css/_blog.styl

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)