Skip to content

Commit 47b7f42

Browse files
authored
Merge pull request #216 from vuejs/master
获取官方更新
2 parents a13b5e4 + a699a59 commit 47b7f42

File tree

7 files changed

+11
-9
lines changed

7 files changed

+11
-9
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
@@ -994,8 +994,10 @@ When the `inline-template` special attribute is present on a child component, th
994994

995995
``` html
996996
<my-component inline-template>
997-
<p>These are compiled as the component's own template.</p>
998-
<p>Not parent's transclusion content.</p>
997+
<div>
998+
<p>These are compiled as the component's own template.</p>
999+
<p>Not parent's transclusion content.</p>
1000+
</div>
9991001
</my-component>
10001002
```
10011003

src/guide/index.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,8 @@ Now you can compose it in another component's template:
265265
<ul>
266266
<!--
267267
Create an instance of the todo-item component
268-
for each todo in a todos array
269268
-->
270-
<todo-item v-for="todo in todos"></todo-item>
269+
<todo-item></todo-item>
271270
</ul>
272271
```
273272

src/guide/join.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Now we'll answer both what the community can do for and what you can do for the
2525

2626
### Contribute Code
2727

28-
As with any project, there are rules to contributing. To ensure that we can help you or accept your pull request as quickly as possible, please read [the contributing guide](https://github.com/vuejs/vue/blob/dev/CONTRIBUTING.md).
28+
As with any project, there are rules to contributing. To ensure that we can help you or accept your pull request as quickly as possible, please read [the contributing guide](https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md).
2929

3030
After that, you'll be ready to contribute to Vue's core repositories:
3131

src/guide/transitions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ This class is mostly useful for specifying the transition timing and easing curv
10841084

10851085
``` js
10861086
new Vue({
1087-
el: '#list-move-demo',
1087+
el: '#flip-list-demo',
10881088
data: {
10891089
items: [1,2,3,4,5,6,7,8,9]
10901090
},

src/support-vuejs/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ However, the amount of effort needed to maintain and develop new features for th
4343

4444
If you run a business and are using Vue in a revenue-generating product, it makes business sense to sponsor Vue development: **it ensures the project that your product relies on stays healthy and actively maintained.** It can also help your exposure in the Vue community and makes it easier to attract Vue developers.
4545

46-
If you are an individual user and have enjoyed the productivity of using Vue, consider donating as a sign of appreciation - like buying me coffee once in a while :)
46+
If you are a business that is building core products using Vue.js, I am also open to conversations regarding custom sponsorship / consulting arrangements. [Get in touch on Twitter](https://twitter.com/youyuxi).
4747

48-
As of now I am exploring the possibility of working on Vue.js fulltime - if you are a business that is building core products using Vue.js, I am also open to conversations regarding custom sponsorship / consulting arrangements. [Get in touch on Twitter](https://twitter.com/youyuxi).
48+
If you are an individual user and have enjoyed the productivity of using Vue, consider donating as a sign of appreciation - like buying me coffee once in a while :)

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)