mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(cli): failed to match arguments in some cases (#11618)
* fix(cli): failed to match arguments in some cases * chore: upd
This commit is contained in:
parent
40d1c97f6b
commit
5954997314
@ -29,9 +29,15 @@ function formatArguments(input: string): VueEventArgument[] {
|
|||||||
} else if ([':', ',', '_', ' '].includes(input[0])) {
|
} else if ([':', ',', '_', ' '].includes(input[0])) {
|
||||||
input = input.substring(1);
|
input = input.substring(1);
|
||||||
} else {
|
} else {
|
||||||
const val = input.match(/( |'|\||\w)+/)![0] || '';
|
const matched = input.match(/( |'|\||\w)+/);
|
||||||
input = input.substring(val.length);
|
|
||||||
items.push(val);
|
if (matched?.length && matched[0]) {
|
||||||
|
const val = matched[0];
|
||||||
|
input = input.substring(val.length);
|
||||||
|
items.push(val);
|
||||||
|
} else {
|
||||||
|
input = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user