Skip to content

Commit 0e49e03

Browse files
committed
获取官方更新
2 parents 49e14f0 + dcccce6 commit 0e49e03

File tree

10 files changed

+111
-105
lines changed

10 files changed

+111
-105
lines changed

src/v2/api/index.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ type: api
10231023

10241024
- **用法:**
10251025

1026-
观察 Vue 实例变化的一个表达式或计算属性函数。回调函数的得到参数为新值和旧值。表达式可以是某个键路径或任意合法绑定表达式
1026+
观察 Vue 实例变化的一个表达式或计算属性函数。回调函数得到的参数为新值和旧值。表达式只接受监督的键路径。对于更复杂的表达式,用一个函数取代
10271027

10281028
<p class="tip">注意:在变异(不是替换)对象或数组时,旧值将与新值相同,因为它们的引用指向同一个对象/数组。Vue 不会保留变异之前值的副本。</p>
10291029

@@ -1035,11 +1035,6 @@ type: api
10351035
// 做点什么
10361036
})
10371037

1038-
// 表达式
1039-
vm.$watch('a + b', function (newVal, oldVal) {
1040-
// 做点什么
1041-
})
1042-
10431038
// 函数
10441039
vm.$watch(
10451040
function () {

src/v2/guide/index.md

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Vue.js 的目标是通过尽可能简单的 API 实现**响应的数据绑定**
1414

1515
## 起步
1616

17-
<p class="tip">The official guide assumes intermediate level front-end knowledge of HTML, CSS and JavaScript. If you are totally new to front-end development, it might not be the best idea to jump right into a framework as your first step - grasp the basics then come back! Prior experience with other frameworks helps, but is not required.</p>
17+
<p class="tip">The official guide assumes intermediate level knowledge of HTML, CSS, and JavaScript. If you are totally new to frontend development, it might not be the best idea to jump right into a framework as your first step - grasp the basics then come back! Prior experience with other frameworks helps, but is not required.</p>
1818

1919
The easiest way to try out Vue.js is using the [JSFiddle Hello World 例子](https://jsfiddle.net/chrisvfritz/50wL7mdz/). Feel free to open it in another tab and follow along as we go through some basic examples. Or, you can simply create an `.html` file and include Vue with:
2020

@@ -271,9 +271,7 @@ Vue.component('todo-item', {
271271

272272
``` html
273273
<ul>
274-
<!--
275-
Create an instance of the todo-item component
276-
-->
274+
<!-- Create an instance of the todo-item component -->
277275
<todo-item></todo-item>
278276
</ul>
279277
```
@@ -295,11 +293,9 @@ Vue.component('todo-item', {
295293
``` html
296294
<div id="app-7">
297295
<ol>
298-
<!--
299-
Now we provide each todo-item with the todo object
300-
it's representing, so that its content can be dynamic
301-
-->
302-
<todo-item v-for="todo in todos" v-bind:todo="todo"></todo-item>
296+
<!-- Now we provide each todo-item with the todo object -->
297+
<!-- it's representing, so that its content can be dynamic -->
298+
<todo-item v-for="item in groceryList" v-bind:todo="item"></todo-item>
303299
</ol>
304300
</div>
305301
```
@@ -309,21 +305,22 @@ Vue.component('todo-item', {
309305
props: ['todo'],
310306
template: '<li>{{ todo.text }}</li>'
311307
})
308+
312309
var app7 = new Vue({
313310
el: '#app-7',
314311
data: {
315-
todos: [
316-
{ text: 'Learn JavaScript' },
317-
{ text: 'Learn Vue' },
318-
{ text: 'Build something awesome' }
312+
groceryList: [
313+
{ text: 'Vegetables' },
314+
{ text: 'Cheese' },
315+
{ text: 'Whatever else humans are supposed to eat' }
319316
]
320317
}
321318
})
322319
```
323320
{% raw %}
324321
<div id="app-7" class="demo">
325322
<ol>
326-
<todo-item v-for="todo in todos" v-bind:todo="todo"></todo-item>
323+
<todo-item v-for="item in groceryList" v-bind:todo="item"></todo-item>
327324
</ol>
328325
</div>
329326
<script>
@@ -334,10 +331,10 @@ Vue.component('todo-item', {
334331
var app7 = new Vue({
335332
el: '#app-7',
336333
data: {
337-
todos: [
338-
{ text: 'Learn JavaScript' },
339-
{ text: 'Learn Vue' },
340-
{ text: 'Build something awesome' }
334+
groceryList: [
335+
{ text: 'Vegetables' },
336+
{ text: 'Cheese' },
337+
{ text: 'Whatever else humans are supposed to eat' }
341338
]
342339
}
343340
})

src/v2/guide/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ vue_version: 2.0.5
66
dev_size: "194.65"
77
min_size: "64.28"
88
gz_size: "23.55"
9-
ro_gz_size: "16"
9+
ro_gz_size: "16.39"
1010
---
1111

1212
### 兼容性

themes/vue/layout/index.ejs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
Copyright &copy; 2014-<%- new Date().getFullYear() %> Evan You
5959
</div>
6060

61-
<script src="/js/common.js"></script>
6261
<script>
6362
var topScrolled = false
6463
window.addEventListener('scroll', function () {

themes/vue/layout/layout.ejs

Lines changed: 45 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,17 @@
1616
<meta name="twitter:description" content="<%- theme.site_description %>">
1717
<meta name="twitter:image" content="https://<%- theme.root_domain %>/images/logo.png">
1818

19+
<link rel="icon" href="/images/logo.png" type="image/x-icon">
20+
1921
<link href='//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600|Roboto Mono' rel='stylesheet' type='text/css'>
2022
<link href='//fonts.googleapis.com/css?family=Dosis:500&text=Vue.js' rel='stylesheet' type='text/css'>
21-
<link href="//cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css" rel='stylesheet' type='text/css'>
22-
<link rel="icon" href="/images/logo.png" type="image/x-icon">
23-
<script>
24-
window.PAGE_TYPE = "<%- page.type %>"
25-
</script>
23+
24+
<!-- main page styles -->
2625
<%- css(isIndex ? 'css/index' : 'css/page') %>
27-
<%- partial('partials/ga') %>
26+
27+
<!-- this needs to be loaded before guide's inline scripts -->
2828
<script src="/js/vue.js"></script>
29+
<script>window.PAGE_TYPE = "<%- page.type %>"</script>
2930
</head>
3031
<body class="<%- isIndex ? '' : 'docs' -%>">
3132
<div id="mobile-bar" <%- isIndex ? 'class="top"' : '' %>>
@@ -42,16 +43,49 @@
4243
<% } %>
4344
</div>
4445
<script src="/js/smooth-scroll.min.js"></script>
45-
<script src="/js/common.js"></script>
4646
<% } else { %>
4747
<%- body %>
4848
<% } %>
4949

50-
<script src="//cdn.bootcss.com/fastclick/1.0.6/fastclick.min.js"></script>
50+
<!-- main custom script for sidebars, version selects etc. -->
51+
<script src="/js/common.js"></script>
52+
53+
<!-- ga -->
54+
<script>
55+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
56+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
57+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
58+
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
59+
60+
ga('create', '<%- theme.google_analytics %>', '<%- theme.root_domain %>');
61+
ga('send', 'pageview');
62+
</script>
63+
64+
<!-- search -->
65+
<link href="//cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css" rel='stylesheet' type='text/css'>
66+
<%- css('css/search') %>
67+
<script src="//cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script>
68+
<script>
69+
[
70+
'#search-query-nav',
71+
'#search-query-sidebar'
72+
].forEach(function (selector) {
73+
if (!document.querySelector(selector)) return
74+
docsearch({
75+
appId: 'BH4D9OD16A',
76+
apiKey: '85cc3221c9f23bfbaa4e3913dd7625ea',
77+
indexName: 'vuejs',
78+
inputSelector: selector
79+
})
80+
})
81+
</script>
82+
83+
<!-- fastclick -->
84+
<script src="//cdnjs.cloudflare.com/ajax/libs/fastclick/1.0.6/fastclick.min.js"></script>
5185
<script>
52-
document.addEventListener('DOMContentLoaded', function() {
53-
FastClick.attach(document.body);
54-
}, false);
86+
document.addEventListener('DOMContentLoaded', function() {
87+
FastClick.attach(document.body)
88+
}, false)
5589
</script>
5690
</body>
5791
</html>

themes/vue/source/css/index.styl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
@import "_common"
22
@import "_header"
3-
@import "_search"
43
@import '_sidebar'
54

65
$width = 900px

themes/vue/source/css/page.styl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
@import "_common"
22
@import "_header"
33
@import "_demo"
4-
@import "_search"
54
@import "_sponsor"
65
@import "_migration"
76
@import "_sidebar"
@@ -111,7 +110,7 @@
111110
font-weight bold
112111
font-family $logo-font
113112
font-size 14px
114-
113+
115114
code
116115
background-color #efefef
117116

0 commit comments

Comments
 (0)