Skip to content

Commit 7268cbd

Browse files
committed
Merge branch 'master' into 2.0-cn
* master: Remove possible fulltime statement and re-arange business part (#520) Fix an error in Component Example (#521) update component inline-template (#519) wrong id (typo) (#515) Set the default color for the search input (#516) fix link to single-file-components.html (#514) fix broken link to contributing guide, fixes #513 # Conflicts: # src/guide/index.md # src/guide/join.md # src/support-vuejs/index.md
2 parents 46e393a + 47b7f42 commit 7268cbd

File tree

7 files changed

+13
-10
lines changed

7 files changed

+13
-10
lines changed

src/_posts/why-no-template-url.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ First, it allows us to write our template in a separate HTML file. This gives us
1313

1414
Second, because `templateURL` loads the template via Ajax at runtime, you don't need a build step in order to split up your files. This is convenient during development, but comes at a serious cost when you want to deploy it to production. Before HTTP/2 is universally supported, the number of HTTP requests is still probably the most critical factor in your app's initial load performance. Now imagine you use `templateURL` for every component in your app - the browser needs to perform dozens of HTTP requests before even being able to display anything! In case you don't know, most browsers limit the number of parallel requests it can perform to a single server. When you exceed that limit, your app's initial rendering will suffer for every extra round trip the browser has to wait for. Sure, there are build tools that can help you pre-register all those templates in `$templateCache` - but that shows us a build step is, in fact, inevitable for any serious frontend development.
1515

16-
So, without `templateURL`, how do we deal with the development experience problem? Writing templates as inline JavaScript strings is terrible, faking templates with `<script type="x/template">` also feels like a hack. Well, maybe it's time to up the game a bit and use a proper module bundler like [Webpack](http://webpack.github.io/) or [Browserify](http://browserify.org/). It might seem daunting if you've never dealt with them before, but trust me it's worth it to take the leap. Proper modularization is a necessity if you want to build anything large and maintainable. More importantly, you get to write your [Vue components in a single file](http://vuejs.org/guide/application.html#Single-File-Components), with proper syntax highlighting and the extra benefits of custom pre-processors, hot-reloading, ES2015 by default, autoprefixing and scoped CSS, which makes the development experience 10 times better.
16+
So, without `templateURL`, how do we deal with the development experience problem? Writing templates as inline JavaScript strings is terrible, faking templates with `<script type="x/template">` also feels like a hack. Well, maybe it's time to up the game a bit and use a proper module bundler like [Webpack](http://webpack.github.io/) or [Browserify](http://browserify.org/). It might seem daunting if you've never dealt with them before, but trust me it's worth it to take the leap. Proper modularization is a necessity if you want to build anything large and maintainable. More importantly, you get to write your [Vue components in a single file](http://vuejs.org/guide/single-file-components.html), with proper syntax highlighting and the extra benefits of custom pre-processors, hot-reloading, ES2015 by default, autoprefixing and scoped CSS, which makes the development experience 10 times better.
1717

1818
Finally, Vue does allow you to [lazy load your components](http://vuejs.org/guide/components.html#Async-Components), and with Webpack it is trivially easy. Although this is only a concern when your initial bundle is so large that you are better off splitting it apart.
1919

src/guide/components.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -991,8 +991,10 @@ template: '<div><stack-overflow></stack-overflow></div>'
991991

992992
``` html
993993
<my-component inline-template>
994-
<p>These are compiled as the component's own template.</p>
995-
<p>Not parent's transclusion content.</p>
994+
<div>
995+
<p>These are compiled as the component's own template.</p>
996+
<p>Not parent's transclusion content.</p>
997+
</div>
996998
</my-component>
997999
```
9981000

src/guide/index.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,10 @@ Vue.component('todo', {
262262

263263
``` html
264264
<ul>
265-
<todo v-for="todo in todos"></todo>
265+
<!--
266+
Create an instance of the todo-item component
267+
-->
268+
<todo-item></todo-item>
266269
</ul>
267270
```
268271

src/guide/join.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Vue.js 的社区正在急速增长中,如果你正在阅读本文,这是你
2626

2727
### 贡献代码
2828

29-
和所有的项目一样,贡献代码是有规范的。为了保证我们能尽快地帮助你解决问题或者接受你的 pull requests,请先阅读这份[贡献指南](https://github.com/vuejs/vue/blob/dev/CONTRIBUTING.md)
29+
和所有的项目一样,贡献代码是有规范的。为了保证我们能尽快地帮助你解决问题或者接受你的 pull requests,请先阅读这份[贡献指南](https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md)
3030

3131
阅读之后,你应该已经准备好向 Vue 的核心仓库贡献代码了:
3232

src/guide/transitions.md

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

11031103
``` js
11041104
new Vue({
1105-
el: '#list-move-demo',
1105+
el: '#flip-list-demo',
11061106
data: {
11071107
items: [1,2,3,4,5,6,7,8,9]
11081108
},

src/support-vuejs/index.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ Vue.js 是采用 MIT 许可的开源项目,使用完全免费。不过,如
4242

4343
如果你是企业经营者并且将 Vue 用在商业产品中,那么赞助 Vue 有商业上的益处:**可以让你的产品保持健康并得到积极的维护**,也能帮助你在 Vue 社区里曝光,从而更容易地吸引到 Vue 开发者。
4444

45+
如果你是企业经营者,并且使用 Vue.js 来开发核心产品,我也可以做顾问。[在 Twitter 上联系我。](https://twitter.com/youyuxi)
4546

4647
如果你是个人开发者并且享受 Vue 带来的高开发效率,可以用捐助来表示你的谢意——比如间或给我买杯咖啡 :)
47-
48-
目前我在寻找全职开发 Vue.js 的机会。如果你是企业经营者,并且使用 Vue.js 来开发核心产品,我也可以做顾问。[在 Twitter 上联系我。](https://twitter.com/youyuxi)
49-
50-
<script src="/js/money.js"></script>

themes/vue/source/css/_header.styl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ body.docs
4242
box-sizing border-box
4343
padding 0 15px 0 30px
4444
border 1px solid #e3e3e3
45+
color $dark
4546
outline none
4647
border-radius 15px
4748
margin-right 10px

0 commit comments

Comments
 (0)