1π
β
It was a miss leading of documentation. There is no API called prompt. It should be dialogs.prompt.
Correct example
<script lang="ts">
import * as dialogs from "tns-core-modules/ui/dialogs";
export default {
methods: {
onButtonTap() {
console.log("Button was pressed");
dialogs.prompt({
title: "Email Prompt",
message: "Provide your email address:",
okButtonText: "OK",
cancelButtonText: "Cancel",
defaultText: "name@domain.com",
inputType: dialogs.inputType.email
}).then(result => {
console.log(`Dialog result: ${result.result},
text: ${result.text}`);
});
}
},
data() {
return {};
}
};
</script>
π€Cem Kaan
Source:stackexchange.com