Przeglądaj źródła

only set option value when the value is present (make tests pass for #861)

Evan You 11 lat temu
rodzic
commit
cae336c00d
1 zmienionych plików z 5 dodań i 2 usunięć
  1. 5 2
      src/directives/model/select.js

+ 5 - 2
src/directives/model/select.js

@@ -105,8 +105,11 @@ function buildOptions (parent, options) {
       if (typeof op === 'string') {
         el.text = el.value = op
       } else {
-        el.text = op.text
-        el.value = op.value
+        /* jshint eqeqeq: false */
+        if (op.value != null) {
+          el.value = op.value
+        }
+        el.text = op.text || op.value || ''
         if (op.disabled) {
           el.disabled = true
         }