[Vuejs]-How to pass object instead of string in Nativescript-vue with typescript?

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

Leave a comment