Skip to content

Commit ae8c4c4

Browse files
committed
use - instead of : for key filters
1 parent 3ed1eed commit ae8c4c4

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

examples/todomvc/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ <h1>todos</h1>
1414
autofocus autocomplete="off"
1515
placeholder="What needs to be done?"
1616
v-model="newTodo"
17-
on-keyup:enter="addTodo">
17+
on-keyup-enter="addTodo">
1818
</header>
1919
<section class="main" v-show="todos.length" v-cloak>
2020
<input class="toggle-all" type="checkbox" v-model="allDone">
@@ -31,8 +31,8 @@ <h1>todos</h1>
3131
v-model="todo.title"
3232
v-todo-focus="todo == editedTodo"
3333
on-blur="doneEdit(todo)"
34-
on-keyup:enter="doneEdit(todo)"
35-
on-keyup:esc="cancelEdit(todo)">
34+
on-keyup-enter="doneEdit(todo)"
35+
on-keyup-esc="cancelEdit(todo)">
3636
</li>
3737
</ul>
3838
</section>

src/deprecations.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ if (process.env.NODE_ENV !== 'production') {
179179
KEY_FILTER: function () {
180180
warn(
181181
'The "key" filter will be deprecated in 1.0.0. Use the new ' +
182-
'on-keyup:key="handler" syntax instead.'
182+
'on-keyup-key="handler" syntax instead.'
183183
)
184184
},
185185

src/directives/on.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = {
99
bind: function () {
1010
// 1.0.0 key filter
1111
var rawArg = this.arg
12-
var keyIndex = rawArg.indexOf(':')
12+
var keyIndex = rawArg.indexOf('-')
1313
if (keyIndex > -1) {
1414
this.arg = rawArg.slice(0, keyIndex)
1515
this.key = rawArg.slice(keyIndex + 1)

test/unit/specs/directives/on_spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ if (_.inBrowser) {
7171
})
7272
})
7373

74-
it('with new syntax key filter', function (done) {
74+
it('with key filter (new syntax)', function (done) {
7575
new Vue({
7676
el: el,
77-
template: '<a on-keyup:enter="test">{{a}}</a>',
77+
template: '<a on-keyup-enter="test">{{a}}</a>',
7878
data: {a: 1},
7979
methods: {
8080
test: function () {

0 commit comments

Comments
 (0)