Skip to content

Commit 215949b

Browse files
committed
warn against v-repeat on <option>
1 parent 588b633 commit 215949b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/directives/repeat.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,18 @@ module.exports = {
4545
this.enterStagger = +this._checkParam('enter-stagger') || stagger
4646
this.leaveStagger = +this._checkParam('leave-stagger') || stagger
4747
this.cache = Object.create(null)
48+
// some helpful tips...
49+
/* istanbul ignore if */
50+
if (
51+
process.env.NODE_ENV !== 'production' &&
52+
this.el.tagName === 'OPTION'
53+
) {
54+
_.warn(
55+
'Don\'t use v-repeat for v-model options; ' +
56+
'use the `options` param instead: ' +
57+
'http://vuejs.org/guide/forms.html#Dynamic_Select_Options'
58+
)
59+
}
4860
},
4961

5062
/**

0 commit comments

Comments
 (0)