File tree Expand file tree Collapse file tree 2 files changed +22
-14
lines changed Expand file tree Collapse file tree 2 files changed +22
-14
lines changed Original file line number Diff line number Diff line change @@ -50,9 +50,10 @@ module.exports = {
50
50
)
51
51
return
52
52
}
53
+ el . __v_model = this
53
54
handler . bind . call ( this )
54
55
this . update = handler . update
55
- this . unbind = handler . unbind
56
+ this . _unbind = handler . unbind
56
57
} ,
57
58
58
59
/**
@@ -72,5 +73,10 @@ module.exports = {
72
73
this . hasWrite = true
73
74
}
74
75
}
76
+ } ,
77
+
78
+ unbind : function ( ) {
79
+ this . el . __v_model = null
80
+ this . _unbind && this . _unbind ( )
75
81
}
76
82
}
Original file line number Diff line number Diff line change @@ -21,6 +21,21 @@ module.exports = {
21
21
*/
22
22
23
23
bind : function ( ) {
24
+
25
+ // some helpful tips...
26
+ /* istanbul ignore if */
27
+ if (
28
+ process . env . NODE_ENV !== 'production' &&
29
+ this . el . tagName === 'OPTION' &&
30
+ this . el . parentNode && this . el . parentNode . __v_model
31
+ ) {
32
+ _ . warn (
33
+ 'Don\'t use v-repeat for v-model options; ' +
34
+ 'use the `options` param instead: ' +
35
+ 'http://vuejs.org/guide/forms.html#Dynamic_Select_Options'
36
+ )
37
+ }
38
+
24
39
// support for item in array syntax
25
40
var inMatch = this . expression . match ( / ( .* ) i n ( .* ) / )
26
41
if ( inMatch ) {
@@ -59,19 +74,6 @@ module.exports = {
59
74
60
75
// create cache object
61
76
this . cache = Object . create ( null )
62
-
63
- // some helpful tips...
64
- /* istanbul ignore if */
65
- if (
66
- process . env . NODE_ENV !== 'production' &&
67
- this . el . tagName === 'OPTION'
68
- ) {
69
- _ . warn (
70
- 'Don\'t use v-repeat for v-model options; ' +
71
- 'use the `options` param instead: ' +
72
- 'http://vuejs.org/guide/forms.html#Dynamic_Select_Options'
73
- )
74
- }
75
77
} ,
76
78
77
79
/**
You can’t perform that action at this time.
0 commit comments