Selaa lähdekoodia

fix watch option in firefox

Evan You 10 vuotta sitten
vanhempi
commit
316ba12887
2 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 1 1
      src/runtime/instance/state.js
  2. 1 1
      src/runtime/util/options.js

+ 1 - 1
src/runtime/instance/state.js

@@ -121,7 +121,7 @@ function initWatch (vm) {
     for (let key in watch) {
       let handler = watch[key]
       let options
-      if (typeof handler === 'object') {
+      if (isPlainObject(handler)) {
         options = handler
         handler = handler.handler
       }

+ 1 - 1
src/runtime/util/options.js

@@ -306,7 +306,7 @@ export function mergeOptions (parent, child, vm) {
     mergeField(key)
   }
   for (key in child) {
-    if (!hasOwn(parent, key)) {
+    if (!(key in parent)) {
       mergeField(key)
     }
   }