Skip to content

Commit 9c5fefe

Browse files
authored
Merge pull request #289 from vuejs/master
获取官方更新
2 parents 3d4660d + a3ccf79 commit 9c5fefe

File tree

10 files changed

+70
-26
lines changed

10 files changed

+70
-26
lines changed

src/v2/api/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1570,7 +1570,7 @@ All lifecycle hooks automatically have their `this` context bound to the instanc
15701570

15711571
- **Usage:**
15721572

1573-
Create a two-way binding on a form input element or a component. For detailed usage, see guide section linked below.
1573+
Create a two-way binding on a form input element or a component. For detailed usage and other notes, see the Guide section linked below.
15741574

15751575
- **See also:**
15761576
- [Form Input Bindings](../guide/forms.html)

src/v2/guide/components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ Vue.component(
10151015
)
10161016
```
10171017

1018-
<p class="tip">If you're a <strong>Browserify</strong> user that would like to use async components, it's unfortunately not possible and probably never will be, as its creator has [made it clear](https://github.com/substack/node-browserify/issues/58#issuecomment-21978224) that async loading "is not something that Browserify will ever support." If this is a feature that's important to you, we recommend using Webpack instead.</p>
1018+
<p class="tip">If you're a <strong>Browserify</strong> user that would like to use async components, its creator has unfortunately [made it clear](https://github.com/substack/node-browserify/issues/58#issuecomment-21978224) that async loading "is not something that Browserify will ever support." Officially, at least. The Browserify community has found [some workarounds](https://github.com/vuejs/vuejs.org/issues/620), which may be helpful for existing and complex applications. For all other scenarios, we recommend simply using Webpack for built-in, first-class async support.</p>
10191019

10201020
### Component Naming Conventions
10211021

src/v2/guide/events.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,17 +224,29 @@ You can also [define custom key modifier aliases](../api/#keyCodes) via the glob
224224
Vue.config.keyCodes.f1 = 112
225225
```
226226

227-
## Mouse Event Modifiers
227+
## Modifier Keys
228228

229229
> New in 2.1.0
230230
231-
You can use the following modifiers to trigger mouse event listeners only when the corresponding key is pressed:
231+
You can use the following modifiers to trigger mouse or keyboard event listeners only when the corresponding modifier key is pressed:
232232

233233
- `.ctrl`
234234
- `.alt`
235235
- `.shift`
236236
- `.meta`
237237

238+
> Note: On Macintosh keyboards, meta is the command key (⌘). On Windows keyboards, meta is the windows key (⊞). On Sun Microsystems keyboards, meta is marked as a solid diamond (◆). On certain keyboards, specifically MIT and Lisp machine keyboards and successors, such as the Knight keyboard, space-cadet keyboard, meta is labeled “META”. On Symbolics keyboards, meta is labeled “META” or “Meta”.
239+
240+
For example:
241+
242+
```html
243+
<!-- Alt + C -->
244+
<input @keyup.alt.67="clear">
245+
246+
<!-- Ctrl + Click -->
247+
<div @click.ctrl="doSomething">Do something</div>
248+
```
249+
238250
## Why Listeners in HTML?
239251

240252
You might be concerned that this whole event listening approach violates the good old rules about "separation of concerns". Rest assured - since all Vue handler functions and expressions are strictly bound to the ViewModel that's handling the current view, it won't cause any maintenance difficulty. In fact, there are several benefits in using `v-on`:

src/v2/guide/forms.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ You can use the `v-model` directive to create two-way data bindings on form inpu
1010

1111
<p class="tip">`v-model` doesn't care about the initial value provided to an input or a textarea. It will always treat the Vue instance data as the source of truth.</p>
1212

13+
<p class="tip" id="vmodel-ime-tip">For languages that require an [IME](https://en.wikipedia.org/wiki/Input_method) (Chinese, Japanese, Korean etc.), you'll notice that `v-model` doesn't get updated during IME composition. If you want to cater for these updates as well, use `input` event instead.</p>
14+
1315
### Text
1416

1517
``` html
@@ -337,7 +339,7 @@ vm.selected.number // -> 123
337339

338340
### `.lazy`
339341

340-
By default, `v-model` syncs the input with the data after each `input` event. You can add the `lazy` modifier to instead sync after `change` events:
342+
By default, `v-model` syncs the input with the data after each `input` event (with the exception of IME composition as [stated above](#vmodel-ime-tip)). You can add the `lazy` modifier to instead sync after `change` events:
341343

342344
``` html
343345
<!-- synced after "change" instead of "input" -->

themes/vue/layout/partials/community_dropdown.ejs

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,29 @@
11
<li class="nav-dropdown-container ecosystem">
22
<a class="nav-link">Ecosystem</a><span class="arrow"></span>
33
<ul class="nav-dropdown">
4-
<li><a href="https://router.vuejs.org/" class="nav-link" target="_blank">vue-router</a></li>
5-
<li><a href="https://vuex.vuejs.org/" class="nav-link" target="_blank">vuex</a></li>
6-
<li><a href="https://github.com/vuejs/vue-cli" class="nav-link" target="_blank">vue-cli</a></li>
7-
<li><a href="https://github.com/vuejs/awesome-vue" class="nav-link" target="_blank">awesome-vue</a></li>
4+
<li><h4>Help</h4></li>
5+
<li><ul>
6+
<li><a href="http://forum.vuejs.org" class="nav-link" target="_blank">Forum</a></li>
7+
<li><a href="https://gitter.im/vuejs/vue" class="nav-link" target="_blank">Chat</a></li>
8+
<li><a href="https://github.com/vuejs-templates" class="nav-link" target="_blank">Templates</a></li>
9+
</ul></li>
10+
<li><h4>News</h4></li>
11+
<li><ul>
12+
<li><a href="https://twitter.com/vuejs" class="nav-link" target="_blank">Twitter</a></li>
13+
<li><a href="https://medium.com/the-vue-point" class="nav-link" target="_blank">Blog</a></li>
14+
<li><a href="https://vuejsjob.com/?ref=vuejs" class="nav-link" target="_blank">Jobs</a></li>
15+
</ul></li>
16+
<li><h4>Core Plugins</h4></li>
17+
<li><ul>
18+
<li><a href="https://router.vuejs.org/" class="nav-link" target="_blank">Vue Router</a></li>
19+
<li><a href="https://vuex.vuejs.org/" class="nav-link" target="_blank">Vuex</a></li>
20+
</ul></li>
21+
<li><h4>Resource Lists</h4></li>
22+
<li><ul>
23+
<li><a href="https://github.com/vuejs" class="nav-link" target="_blank">Official Repos</a></li>
24+
<li><a href="https://github.com/vuejs/awesome-vue" class="nav-link" target="_blank">Awesome Vue</a></li>
25+
</ul></li>
826
</ul>
927
</li>
28+
29+

themes/vue/layout/partials/language_dropdown.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<li class="nav-dropdown-container language">
2-
<a class="nav-link">Language</a><span class="arrow"></span>
2+
<a class="nav-link">Translations</a><span class="arrow"></span>
33
<ul class="nav-dropdown">
44
<li><a href="https://cn.vuejs.org/" class="nav-link" target="_blank">中文</a></li>
55
<li><a href="https://jp.vuejs.org/" class="nav-link" target="_blank">日本語</a></li>

themes/vue/layout/partials/main_menu.ejs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,5 @@
66
<li><a href="/v2/guide/" class="nav-link<%- page.path.match(/guide/) ? ' current' : '' %>">Guide</a></li>
77
<li><a href="/v2/api/" class="nav-link<%- page.path.match(/api/) ? ' current' : '' %>">API</a></li>
88
<li><a href="/v2/examples/" class="nav-link<%- page.path.match(/examples/) ? ' current' : '' %>">Examples</a></li>
9-
<li><a href="https://medium.com/the-vue-point" target="_blank" class="nav-link<%- page.path.match(/blog/) ? ' current' : '' %>">Blog</a></li>
10-
<%- partial('partials/community_dropdown') %>
119
<%- partial('partials/ecosystem_dropdown') %>
1210
<%- partial('partials/language_dropdown') %>

themes/vue/source/css/_common.styl

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,18 @@ a.button
150150
&:hover
151151
.nav-dropdown
152152
display block
153-
&.ecosystem, &.language
153+
&.language
154154
margin-left 20px
155+
.arrow
156+
pointer-events none
155157
.nav-dropdown
156158
display none
159+
box-sizing border-box
160+
max-height "calc(100vh - %s)" % $header-height
161+
overflow-y scroll
157162
position absolute
158163
top 100%
159-
left 0
164+
right -15px
160165
background-color #fff
161166
padding 10px 0
162167
border 1px solid #ddd
@@ -168,11 +173,24 @@ a.button
168173
line-height 1.8em
169174
margin 0
170175
display block
176+
> ul
177+
padding-left: 0
178+
&:first-child
179+
h4
180+
margin-top 0
181+
padding-top: 0
182+
border-top: 0
183+
a, h4
184+
padding 0 24px 0 20px
185+
h4
186+
// text-transform uppercase
187+
margin .45em 0 0
188+
padding-top: .45em
189+
border-top: 1px solid #eee
171190
a
172-
color $light
191+
color lighten($dark, 10%)
173192
font-size .9em
174193
display block
175-
padding 0 24px 0 20px
176194
&:hover
177195
color $green
178196
.arrow

themes/vue/source/css/_sidebar.styl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@
7575
padding 4px 0
7676
text-align center
7777
margin-bottom 20px
78+
.nav-dropdown
79+
h4
80+
font-weight normal
81+
margin: 0
7882

7983
@media screen and (max-width: 900px)
8084
.sidebar

0 commit comments

Comments
 (0)