mirror of
https://gitee.com/openharmony/napi_generator
synced 2024-11-23 08:20:01 +00:00
showInputBox输入有效性判断
Signed-off-by: chen-zhongwei050 <chenzhongwei050@chinasoftinc.com>
This commit is contained in:
parent
b6ca5e34f5
commit
4dff021267
@ -149,11 +149,14 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
placeHolder: 'Please input...',
|
||||
validateInput: (input) => {
|
||||
if (!input) {
|
||||
return "Input cannot be empty";
|
||||
return "Input cannot be empty";
|
||||
}
|
||||
if (input !== value) {
|
||||
return "Inconsistent input"
|
||||
}
|
||||
}
|
||||
});
|
||||
if (value === what && value === 'Hdf Framework') {
|
||||
if (value === 'Hdf Framework') {
|
||||
// ÊäÈë°æ±¾
|
||||
let versionTag = '4.1';
|
||||
const version = await vscode.window.showQuickPick(['OpenHarmony 4.1 release'], { placeHolder: 'Please select the version...' })
|
||||
@ -161,7 +164,7 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
versionTag === '4.1'
|
||||
}
|
||||
generateHdf(hdfInputPath, versionTag);
|
||||
} else if (value === what && value === 'SystemAbility Framework') {
|
||||
} else if (value === 'SystemAbility Framework') {
|
||||
// ÊäÈë°æ±¾
|
||||
let versionTag = '3.2';
|
||||
const version = await vscode.window.showQuickPick(['OpenHarmony 3.2 release', 'OpenHarmony 4.1 release'], { placeHolder: 'Please select the version...' })
|
||||
@ -182,10 +185,8 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
}
|
||||
});
|
||||
generateSa(hPath, versionTag, serviceId as string);
|
||||
} else if (value === what && value === 'N-API Framework') {
|
||||
} else if (value === 'N-API Framework') {
|
||||
generateDtscpp(hPath);
|
||||
} else {
|
||||
vscode.window.showInformationMessage('请重新输入...');
|
||||
}
|
||||
});
|
||||
context.subscriptions.push(ohGenerator);
|
||||
|
Loading…
Reference in New Issue
Block a user