I want to implement PromptDialog as in {N} Playground Code
import dialogs from "tns-core-modules/ui/dialogs";
export default {
methods: {
onButtonTap() {
console.log("Button was pressed");
prompt({
title: "Email Prompt",
message: "Provide your email address:",
okButtonText: "OK",
cancelButtonText: "Cancel",
defaultText: "[email protected]",
inputType: dialogs.inputType.email
}).then(result => {
console.log(`Dialog result: ${result.result},
text: ${result.text}`);
});
}
},
}
But Vetur is giving following Typescript error.
Argument of type '{ title: string; message: string; okButtonText: string; cancelButtonText: string; defaultText: string; inputType: string; }' is not assignable to parameter of type 'string'.
This is just example code in nativescript-vue prompt documentation but typescript adaption.
Basic use
forgotPassword() {
prompt('Your message to the user', 'Suggested user input').then(result => {
console.log(`Dialog result: ${result.result}, text: ${result.text}`);
});
}
Vetur Error:
Property 'then' does not exist on type 'string'.
promptaccepts astringas parameter, if we are talking about this: developer.mozilla.org/en-US/docs/Web/API/Window/prompt