Skip to content

Commit 6bf30fe

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 3ea96a4 + a6a9735 commit 6bf30fe

File tree

5 files changed

+26
-5
lines changed

5 files changed

+26
-5
lines changed

src/v2/guide/components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1088,7 +1088,7 @@ Within HTML templates though, you have to use the kebab-case equivalents:
10881088
<title-cased-component></title-cased-component>
10891089
```
10901090

1091-
When using _string_ templates however, we're not bound by HTML's case-insensitive restrictions. That means even in the template, you reference your components and props using camelCase, TitleCase, or kebab-case:
1091+
When using _string_ templates however, we're not bound by HTML's case-insensitive restrictions. That means even in the template, you can reference your components and props using camelCase, TitleCase, or kebab-case:
10921092

10931093
``` html
10941094
<!-- use whatever you want in string templates! -->

src/v2/guide/events.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ new Vue({
144144
Sometimes we also need to access the original DOM event in an inline statement handler. You can pass it into a method using the special `$event` variable:
145145

146146
``` html
147-
<button v-on:click="warn('Form cannot be submitted yet.', $event)">Submit</button>
147+
<button v-on:click="warn('Form cannot be submitted yet.', $event)">
148+
Submit
149+
</button>
148150
```
149151

150152
``` js

src/v2/guide/list.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ var example1 = new Vue({
4949
},
5050
watch: {
5151
items: function () {
52-
smoothScroll.animateScroll(null, '#example-1')
52+
smoothScroll.animateScroll(document.querySelector('#example-1'))
5353
}
5454
}
5555
})
@@ -99,7 +99,7 @@ var example2 = new Vue({
9999
},
100100
watch: {
101101
items: function () {
102-
smoothScroll.animateScroll(null, '#example-2')
102+
    smoothScroll.animateScroll(document.querySelector('#example-2'))
103103
}
104104
}
105105
})

src/v2/guide/migration-vue-router.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,23 @@ if (route.meta.requiresAuth) {
236236
</div>
237237
{% endraw %}
238238

239+
### [] Syntax for Arrays in Queries <sup>removed</sup>
240+
241+
When passing arrays to query parameters the QueryString syntax is no longer `/foo?users[]=Tom&users[]=Jerry`, instead, the new syntax is `/foo?users=Tom&users=Jerry`. Internally, `$route.query.users` will still be an Array, but if there's only one parameter in the query: `/foo?users=Tom`, when directly accessing this route, there's no way for the router to know if we were expecting `users` to be an Array. Because of this, consider adding a computed property and replacing every reference of `$route.query.users` with it:
242+
243+
```javascript
244+
export default {
245+
// ...
246+
computed: {
247+
// users will always be an array
248+
users () {
249+
const users = this.$route.query.users
250+
return Array.isArray(users) ? users : [users]
251+
}
252+
}
253+
}
254+
```
255+
239256
## Route Matching
240257

241258
Route matching now uses [path-to-regexp](https://github.com/pillarjs/path-to-regexp) under the hood, making it much more flexible than previously.

src/v2/guide/render-function.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,9 @@ Everything the component needs is passed through `context`, which is an object c
478478

479479
After adding `functional: true`, updating the render function of our anchored heading component would simply require adding the `context` argument, updating `this.$slots.default` to `context.children`, then updating `this.level` to `context.props.level`.
480480

481-
Since functional components are just functions, they're much cheaper to render. They're also very useful as wrapper components. For example, when you need to:
481+
Since functional components are just functions, they're much cheaper to render. However, this also mean that functional components don't show up in VueJS Chrome dev tools component tree.
482+
483+
They're also very useful as wrapper components. For example, when you need to:
482484

483485
- Programmatically choose one of several other components to delegate to
484486
- Manipulate children, props, or data before passing them on to a child component

0 commit comments

Comments
 (0)