mirror of
https://github.com/youzan/vant.git
synced 2025-10-18 17:51:54 +00: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:
@@ -29,9 +29,15 @@ function formatArguments(input: string): VueEventArgument[] {
|
||||
} else if ([':', ',', '_', ' '].includes(input[0])) {
|
||||
input = input.substring(1);
|
||||
} else {
|
||||
const val = input.match(/( |'|\||\w)+/)![0] || '';
|
||||
input = input.substring(val.length);
|
||||
items.push(val);
|
||||
const matched = input.match(/( |'|\||\w)+/);
|
||||
|
||||
if (matched?.length && matched[0]) {
|
||||
const val = matched[0];
|
||||
input = input.substring(val.length);
|
||||
items.push(val);
|
||||
} else {
|
||||
input = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user