select
Description
a function called on date selectionType
function
Example
<script>
import { Month, Button } from "wx-svelte-core";
let value = new Date();
let showMonth = false;
const show = () => {
showMonth = true;
};
const select = date => {
value = date;
};
const cancel = () => {
showMonth = false;
};
</script>
<div class="demo-box" style="width: 300px">
<div style="margin: 20px;">{value}</div>
<div style="margin: 20px;">
<Button click={show}>Open month</Button>
</div>
{#if showMonth}
<Month {value} part="normal" current={value} {select} {cancel} />
{/if}
</div>
Details
The select() function takes as a parameter the selected date.
Related article: Handling date selection