Skip to content

Commit 710a8fa

Browse files
committedFeb 16, 2017
Merge remote-tracking branch 'upstream/master'
# Conflicts: # src/v2/api/index.md # src/v2/guide/installation.md
2 parents bc92bd8 + d4a5a1b commit 710a8fa

File tree

5 files changed

+28
-6
lines changed

5 files changed

+28
-6
lines changed
 

‎src/v2/api/index.md

+18
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,24 @@ type: api
329329
```
330330

331331
- **Voir aussi :** [Fonctions de rendu](../guide/render-function.html)
332+
Has a comment. Original line has a comment.
333+
<h3 id="Vue-version">Vue.version</h3>
334+
335+
- **Details**: Provides the installed version of Vue as a string. This is especially useful for community plugins and components, where you might use different strategies for different versions.
336+
337+
- **Usage**:
338+
339+
```js
340+
var version = Number(Vue.version.split('.')[0])
341+
342+
if (version === 2) {
343+
// Vue v2.x.x
344+
} else if (version === 1) {
345+
// Vue v1.x.x
346+
} else {
347+
// Unsupported versions of Vue
348+
}
349+
```
332350

333351
## Options / Data
334352

‎src/v2/cookbook/adding-instance-properties.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Vue.prototype.$reverseText = function (propertyName) {
113113

114114
new Vue({
115115
data: {
116-
message: 'Hello '
116+
message: 'Hello'
117117
},
118118
created: function () {
119119
console.log(this.message) // => "Hello"

‎src/v2/guide/custom-directive.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Directive hooks are passed these arguments:
8989
An example of a custom directive using some of these properties:
9090

9191
``` html
92-
<div id="hook-arguments-example" v-demo:hello.a.b="message"></div>
92+
<div id="hook-arguments-example" v-demo:foo.a.b="message"></div>
9393
```
9494

9595
``` js
@@ -115,7 +115,7 @@ new Vue({
115115
```
116116

117117
{% raw %}
118-
<div id="hook-arguments-example" v-demo:hello.a.b="message" class="demo"></div>
118+
<div id="hook-arguments-example" v-demo:foo.a.b="message" class="demo"></div>
119119
<script>
120120
Vue.directive('demo', {
121121
bind: function (el, binding, vnode) {

‎src/v2/guide/render-function.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,7 @@ You may be interested to know that Vue's templates actually compile to render fu
546546
<pre><code>{{ result.render }}</code></pre>
547547
<label>staticRenderFns:</label>
548548
<pre v-for="(fn, index) in result.staticRenderFns"><code>_m({{ index }}): {{ fn }}</code></pre>
549+
<pre v-if="!result.staticRenderFns.length"><code>{{ result.staticRenderFns }}</code></pre>
549550
</div>
550551
<div v-else>
551552
<label>Compilation Error:</label>
@@ -558,7 +559,9 @@ new Vue({
558559
data: {
559560
templateText: '\
560561
<div>\n\
561-
<h1>I\'m a template!</h1>\n\
562+
<header>\n\
563+
<h1>I\'m a template!</h1>\n\
564+
</header>\n\
562565
<p v-if="message">\n\
563566
{{ message }}\n\
564567
</p>\n\
@@ -605,7 +608,7 @@ console.error = function (error) {
605608
}
606609
#vue-compile-demo textarea {
607610
width: 100%;
608-
611+
font-family: monospace;
609612
}
610613
</style>
611614
{% endraw %}

‎themes/vue/source/css/_migration.styl

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
margin-left: .3em
55
color: #b9465c
66
.upgrade-path
7+
margin-top: 2em
78
padding: 2em
89
background: rgba(73, 195, 140, .1)
910
border-radius: 2px
1011
> h4
1112
margin-top: 0
1213
> p:last-child
1314
margin-bottom: 0
14-
15+
padding-bottom: 0

0 commit comments

Comments
 (0)
Please sign in to comment.