Skip to content

Custom close button #55

@en-do

Description

@en-do

Hello everyone!
I want to create a custom close button with its own message as native alert. How is this implemented in a component <ClosingConfirmation>

I have this code. But I don't get the native alert, I only get the app closing :(
Please, I need help!

<script setup>
import {
  useWebAppClosingConfirmation
} from 'vue-tg'

const { enableClosingConfirmation, isClosingConfirmationEnabled } = useWebAppClosingConfirmation();

enableClosingConfirmation();

function close() {
  useWebApp().close();
}
</script>

<template>
<button type="button" class="nav-link text-danger px-4 py-3 d-flex align-items-center" @click="logout()">
  close app
</button>
</template>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions