SheetModal は特殊なオーバーレイタイプです。このモーダルを使用すると、カスタムコンテンツを持つカスタムピッカーオーバーレイを作成できます。
以下のコンポーネントが含まれています。
Sheet
- シートモーダル要素名前 | 型 | デフォルト | 説明 |
---|---|---|---|
backdrop | boolean | true | Sheetモーダルのバックドロップ(後ろの暗い半透明レイヤー)を有効にします。 |
colors | object | Tailwind CSSカラークラスを持つオブジェクト | |
colors.bgIos | string | 'bg-white dark:bg-black' | |
colors.bgMaterial | string | 'bg-md-light-surface dark:bg-md-dark-surface' | |
component | string | 'div' | コンポーネントのHTML要素 |
opened | boolean | false | Sheetモーダルを開閉し、初期状態を設定できます。 |
名前 | 型 | 説明 |
---|---|---|
backdropclick | function(e) | バックドロップ要素のクリックハンドラー |
<template><k-page><k-navbar title="Sheet Modal" /><k-block strong-ios outline-ios class="space-y-4"><p>Sheet Modals slide up from the bottom of the screen to reveal morecontent. Such modals allow to create custom overlays with customcontent.</p><p><k-button @click="() => (sheetOpened = true)">Open Sheet</k-button></p></k-block><k-sheetclass="pb-safe":opened="sheetOpened"@backdropclick="() => (sheetOpened = false)"><k-toolbar top><div class="left" /><div class="right"><k-link toolbar @click="() => (sheetOpened = false)"> Done </k-link></div></k-toolbar><k-block><p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Harum adexcepturi nesciunt nobis aliquam. Quibusdam ducimus nequenecessitatibus, molestias cupiditate velit nihil alias incidunt,excepturi voluptatem dolore itaque sapiente dolores!</p><div class="mt-4"><k-button @click="() => (sheetOpened = false)">Action</k-button></div></k-block></k-sheet></k-page></template><script>import { ref } from 'vue';import {kPage,kNavbar,kNavbarBackLink,kSheet,kBlock,kButton,kToolbar,kLink,} from 'konsta/vue';export default {components: {kPage,kNavbar,kNavbarBackLink,kSheet,kBlock,kButton,kToolbar,kLink,},setup() {const sheetOpened = ref(false);return {sheetOpened,};},};</script>