File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
packages/babel-sugar-v-model/src Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -53,16 +53,16 @@ const parseVModel = (t, path) => {
53
53
if ( t . isJSXNamespacedName ( path . get ( 'name' ) ) || ! startsWithCamel ( path . get ( 'name.name' ) . node , 'v-model' ) ) {
54
54
return null
55
55
}
56
- let modifiers = null
57
- let _
56
+
58
57
if ( ! t . isJSXExpressionContainer ( path . get ( 'value' ) ) ) {
59
58
throw new Error ( 'You have to use JSX Expression inside your v-model' )
60
- } else if ( t . isJSXIdentifier ( path . get ( 'name' ) ) ) {
61
- ; [ _ , ...modifiers ] = path . get ( 'name.name' ) . node . split ( '_' )
62
- modifiers = new Set ( modifiers )
63
59
}
60
+
61
+ const modifiers = path . get ( 'name.name' ) . node . split ( '_' )
62
+ modifiers . shift ( )
63
+
64
64
return {
65
- modifiers : modifiers ,
65
+ modifiers : new Set ( modifiers ) ,
66
66
valuePath : path . get ( 'value.expression' ) ,
67
67
}
68
68
}
You can’t perform that action at this time.
0 commit comments