Skip to main content

cancel

Description

sets the function that closes a popup

Type

function

Example

<script>
import { Button, Popup} from "wx-svelte-core";

let showPopup = false;

function click() {
showPopup = true;
}

function cancel() {
showPopup = false;
}
</script>

<div>
<Button {click}>Show Popup</Button>
</div>

{#if showPopup}
<Popup {cancel} >
<div class="popup">
<p>Some text here and there</p>
</div>
</Popup>
{/if}

Related article: Showing/hiding Popup

Related sample: Popup