Skip to content

Commit 2d6e50e

Browse files
committed
use - instead of : for key filters
1 parent c113b85 commit 2d6e50e

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
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/directives/internal/on.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ module.exports = {
4141
bind: function () {
4242
// 1.0.0 key filter
4343
var rawEvent = this.event = this.descriptor.arg
44-
var keyIndex = rawEvent.indexOf(':')
44+
var keyIndex = rawEvent.indexOf('-')
4545
if (keyIndex > -1) {
4646
this.event = rawEvent.slice(0, keyIndex)
4747
this.key = rawEvent.slice(keyIndex + 1)

test/unit/specs/directives/internal/on_spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ if (_.inBrowser) {
5353
it('with key filter', function (done) {
5454
new Vue({
5555
el: el,
56-
template: '<a on-keyup:enter="test">{{a}}</a>',
56+
template: '<a on-keyup-enter="test">{{a}}</a>',
5757
data: {a: 1},
5858
methods: {
5959
test: function () {
@@ -74,7 +74,7 @@ if (_.inBrowser) {
7474
it('with key filter (keycode)', function (done) {
7575
new Vue({
7676
el: el,
77-
template: '<a on-keyup:13="test">{{a}}</a>',
77+
template: '<a on-keyup-13="test">{{a}}</a>',
7878
data: {a: 1},
7979
methods: {
8080
test: function () {

0 commit comments

Comments
 (0)