mirror of
https://github.com/youzan/vant.git
synced 2025-10-19 01:54:48 +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])) {
|
} 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 = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user