Evan You 10 лет назад
Родитель
Сommit
fcb3288be2
1 измененных файлов с 15 добавлено и 0 удалено
  1. 15 0
      src/directives/for.js

+ 15 - 0
src/directives/for.js

@@ -7,6 +7,21 @@ var uid = 0
 module.exports = {
 
   bind: function () {
+
+    // some helpful tips...
+    /* istanbul ignore if */
+    if (
+      process.env.NODE_ENV !== 'production' &&
+      this.el.tagName === 'OPTION' &&
+      this.el.parentNode && this.el.parentNode.__v_model
+    ) {
+      _.warn(
+        'Don\'t use v-for for v-model options; ' +
+        'use the `options` param instead: ' +
+        'http://vuejs.org/guide/forms.html#Dynamic_Select_Options'
+      )
+    }
+
     // determine alias
     this.alias = this.arg
     // support "item in items" syntax