🔥 新しいプロジェクトをご紹介 t0ggles -究極のプロジェクト管理ツール! 🔥

アクションシート Vue コンポーネント

アクションシートは、ユーザーに特定のタスクの処理方法に関する選択肢を提供するための、スライドアップパネルです。

潜在的に危険なアクションの確認をユーザーに促すためにも、アクションシートを使用できます。

アクションシートには、オプションのタイトルと1つ以上のボタンが含まれており、各ボタンは実行するアクションに対応しています。

アクションシートコンポーネント

次のコンポーネントが含まれています。

  • Actions
  • ActionsButton
  • ActionsLabel
  • ActionsGroup

Actions プロパティ

名前デフォルト説明
backdropbooleantrue

アクションシートのバックドロップ(背後にある暗い半透明レイヤー)を有効にします。

componentstring'div'

コンポーネントのHTML要素

openedbooleanfalse

アクションシートを開閉し、初期状態を設定できます。

Actions イベント

名前説明
backdropclickfunction(e)

バックドロップ要素のクリックハンドラー

ActionsButton プロパティ

名前デフォルト説明
boldbooleanundefined

ボタンのテキストを太字にします。boldIosboldMaterialを上書きします。

boldIosbooleanfalse

iOSテーマでボタンのテキストを太字にします。

boldMaterialbooleanfalse

Materialテーマでボタンのテキストを太字にします。

colorsobject

Tailwind CSSカラークラスを含むオブジェクト

colors.activeBgIosstring'active:bg-neutral-200 dark:active:bg-neutral-700'
colors.activeBgMaterialstring''
colors.bgIosstring'bg-white dark:bg-neutral-800'
colors.bgMaterialstring'bg-md-light-surface-3 dark:bg-md-dark-surface-3'
colors.textIosstring'text-primary'
colors.textMaterialstring'text-md-light-on-surface dark:text-md-dark-on-surface'
componentstring'button'

コンポーネントのHTML要素

dividersbooleanundefined

ボタンの外側のヘアライン(ボーダー)を描画します。指定されていない場合、iOSテーマで有効になります。

fontSizeIosstring'text-xl'

iOSテーマでのボタンテキストのフォントサイズ

fontSizeMaterialstring'text-base'

Materialテーマでのボタンテキストのフォントサイズ

hrefstring

リンクのhref属性。指定すると、<a>要素としてもレンダリングされます。

touchRipplebooleantrue

Materialテーマでタッチリップル効果を有効にします。

ActionsLabel プロパティ

名前デフォルト説明
colorsobject

Tailwind CSSカラークラスを含むオブジェクト

colors.bgIosstring'bg-white dark:bg-neutral-800'
colors.bgMaterialstring'bg-md-light-surface-3 dark:bg-md-dark-surface-3'
colors.textIosstring'text-black text-opacity-55 dark:text-white dark:text-opacity-55'
colors.textMaterialstring'text-md-light-primary dark:text-md-dark-primary'
componentstring'div'

コンポーネントのHTML要素

dividersbooleanundefined

ボタンの外側のヘアライン(ボーダー)を描画します。指定されていない場合、iOSテーマで有効になります。

fontSizeIosstring'text-sm'

iOSテーマでのボタンテキストのフォントサイズ

fontSizeMaterialstring'text-sm'

Materialテーマでのボタンテキストのフォントサイズ

ActionsGroup プロパティ

名前デフォルト説明
componentstring'div'

コンポーネントのHTML要素

dividersbooleantrue

グループの外側のヘアライン(ボーダー)を描画します。(Materialテーマのみ)

ActionSheet.vue
<template>
<k-page>
<k-navbar title="ActionSheet" />
<k-block strong inset class="space-y-4">
<p>
Action Sheet is a slide-up pane for presenting the user with a set of
alternatives for how to proceed with a given task.
</p>
</k-block>
<k-block-title>Open Action Sheet</k-block-title>
<k-block strong inset class="flex space-x-4 rtl:space-x-reverse">
<k-button @click="() => (actionsOneOpened = true)">One group</k-button>
<k-button @click="() => (actionsTwoOpened = true)">Two groups</k-button>
</k-block>
<k-actions
:opened="actionsOneOpened"
@backdropclick="() => (actionsOneOpened = false)"
>
<k-actions-group>
<k-actions-label>Do something</k-actions-label>
<k-actions-button bold @click="() => (actionsOneOpened = false)">
Button 1
</k-actions-button>
<k-actions-button @click="() => (actionsOneOpened = false)">
Button 2
</k-actions-button>
<k-actions-button @click="() => (actionsOneOpened = false)">
Cancel
</k-actions-button>
</k-actions-group>
</k-actions>
<k-actions
:opened="actionsTwoOpened"
@backdropclick="() => (actionsTwoOpened = false)"
>
<k-actions-group>
<k-actions-label>Do something</k-actions-label>
<k-actions-button bold @click="() => (actionsTwoOpened = false)">
Button 1
</k-actions-button>
<k-actions-button @click="() => (actionsTwoOpened = false)">
Button 2
</k-actions-button>
</k-actions-group>
<k-actions-group>
<k-actions-button @click="() => (actionsTwoOpened = false)">
Cancel
</k-actions-button>
</k-actions-group>
</k-actions>
</k-page>
</template>
<script>
import {
kPage,
kNavbar,
kNavbarBackLink,
kBlockTitle,
kBlock,
kButton,
kActions,
kActionsButton,
kActionsLabel,
kActionsGroup,
} from 'konsta/vue';
import { ref } from 'vue';
export default {
components: {
kPage,
kNavbar,
kNavbarBackLink,
kBlockTitle,
kBlock,
kButton,
kActions,
kActionsButton,
kActionsLabel,
kActionsGroup,
},
setup() {
const actionsOneOpened = ref(false);
const actionsTwoOpened = ref(false);
return {
actionsOneOpened,
actionsTwoOpened,
};
},
};
</script>
ライセンス MIT.
2022 © Konsta UI by nolimits4web.