File tree Expand file tree Collapse file tree 3 files changed +31
-1
lines changed
test/validator/samples/binding-select-multiple-dynamic Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -102,7 +102,20 @@ export default function validateElement(
102102 ) ;
103103 }
104104
105- checkTypeAttribute ( validator , node ) ;
105+ if ( node . name === 'select' ) {
106+ const attribute = node . attributes . find (
107+ ( attribute : Node ) => attribute . name === 'multiple'
108+ ) ;
109+
110+ if ( attribute && isDynamic ( attribute ) ) {
111+ validator . error (
112+ `'multiple' attribute cannot be dynamic if select uses two-way binding` ,
113+ attribute
114+ ) ;
115+ }
116+ } else {
117+ checkTypeAttribute ( validator , node ) ;
118+ }
106119 } else if ( name === 'checked' || name === 'indeterminate' ) {
107120 if ( node . name !== 'input' ) {
108121 validator . error (
Original file line number Diff line number Diff line change 1+ [{
2+ "message" : " 'multiple' attribute cannot be dynamic if select uses two-way binding" ,
3+ "loc" : {
4+ "line" : 1 ,
5+ "column" : 19
6+ },
7+ "end" : {
8+ "line" : 1 ,
9+ "column" : 28
10+ },
11+ "pos" : 19
12+ }]
Original file line number Diff line number Diff line change 1+ < select bind:value :multiple >
2+ < option > 1</ option >
3+ < option > 2</ option >
4+ < option > 3</ option >
5+ </ select >
You can’t perform that action at this time.
0 commit comments