We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6f8316f commit 724a593Copy full SHA for 724a593
src/core/instance/state.js
@@ -142,7 +142,11 @@ function initMethods (vm: Component) {
142
const methods = vm.$options.methods
143
if (methods) {
144
for (const key in methods) {
145
- vm[key] = bind(methods[key], vm)
+ if (methods[key] != null) {
146
+ vm[key] = bind(methods[key], vm)
147
+ } else if (process.env.NODE_ENV !== 'production') {
148
+ warn(`The method ${key} on vue instance is undefined.`, vm)
149
+ }
150
}
151
152
0 commit comments