Skip to content

Commit ccc6d57

Browse files
committed
add key filter deprecation
1 parent da5e600 commit ccc6d57

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/deprecations.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,13 @@ if (process.env.NODE_ENV !== 'production') {
163163
'v-ref or ref can no longer be used on a component root in its own ' +
164164
'template in 1.0.0. Use it in the parent template instead.'
165165
)
166+
},
167+
168+
KEY_FILTER: function () {
169+
warn(
170+
'The "key" filter will be deprecated in 1.0.0. Use the new ' +
171+
'on-keyup:key="handler" syntax instead.'
172+
)
166173
}
167174

168175
}

src/directives/on.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@ module.exports = {
1515
this.key = rawArg.slice(keyIndex + 1)
1616
}
1717

18+
// warn old usage
19+
if (process.env.NODE_ENV !== 'production') {
20+
if (this.filters) {
21+
var hasKeyFilter = this.filters.some(function (f) {
22+
return f.name === 'key'
23+
})
24+
if (hasKeyFilter) {
25+
_.deprecation.KEY_FILTER()
26+
}
27+
}
28+
}
29+
1830
// deal with iframes
1931
if (
2032
this.el.tagName === 'IFRAME' &&

0 commit comments

Comments
 (0)