Readouble

Livewire v3 wire:confirm

wire:confirm

Livewireで危険な操作を実行する前に、ユーザーに何らかの視覚的な確認を提供したい場合があります。Before performing dangerous actions in Livewire, you may want to provide your users with some sort of visual confirmation.

Livewireでは、アクション (wire:clickwire:submitなど) に加えて wire:confirm を追加することで、これを簡単に行うことができます。Livewire makes this easy to do by adding wire:confirm in addition to any action (wire:click, wire:submit, etc.).

以下は、「Delete post」ボタンに確認ダイアログを追加する例です。Here's an example of adding a confirmation dialog to a "Delete post" button:

<button
    type="button"
    wire:click="delete"
    wire:confirm="Are you sure you want to delete this post?"
>
    Delete post <!-- [tl! highlight:-2,1] -->
</button>

ユーザーが「Delete post」をクリックすると、Livewireは確認ダイアログ(デフォルトのブラウザ確認アラート)をトリガーします。ユーザーがEscapeキーを押すか、キャンセルを押すと、アクションは実行されません。「OK」を押すと、アクションが完了します。When a user clicks "Delete post", Livewire will trigger a confirmation dialog (The default browser confirmation alert). If the user hits escape or presses cancel, the action won't be performed. If they press "OK", the action will be completed.

ユーザーに入力を求めるPrompting users for input

ユーザーのアカウントを完全に削除するなどの、さらに危険な操作の場合、特定の一連の文字を入力してアクションを確認する必要がある確認プロンプトを表示したい場合があります。For even more dangerous actions such as deleting a user's account entirely, you may want to present them with a confirmation prompt which they would need to type in a specific string of characters to confirm the action.

Livewireは、便利な .prompt 修飾子を提供します。これは wire:confirm に適用されると、ユーザーに入力を求め、入力が指定された文字列(wire:confirm 値の最後に "|" (パイプ) 文字で指定)と一致する場合にのみアクションを確認します。Livewire provides a helpful .prompt modifier, that when applied to wire:confirm, it will prompt the user for input and only confirm the action if the input matches (case-sensitive) the provided string (designated by a "|" (pipe) character at the end if the wire:confirm value):

<button
    type="button"
    wire:click="delete"
    wire:confirm.prompt="Are you sure?\n\nType DELETE to confirm|DELETE"
>
    Delete account <!-- [tl! highlight:-2,1] -->
</button>

ユーザーが「Delete account」を押すと、「DELETE」がプロンプトに入力された場合にのみアクションが実行され、それ以外の場合はアクションがキャンセルされます。When a user presses "Delete account", the action will only be performed if "DELETE" is entered into the prompt, otherwise, the action will be cancelled.

章選択

パッケージ

設定

バージョン変更
linkv3 linkv2
明暗テーマ
light_mode
dark_mode
brightness_auto システム設定に合わせる
テーマ選択
photo_size_select_actual デフォルト
photo_size_select_actual モノクローム(白黒)
photo_size_select_actual Solarized風
photo_size_select_actual GitHub風(青ベース)
photo_size_select_actual Viva(黄緑ベース)
photo_size_select_actual Happy(紫ベース)
photo_size_select_actual Mint(緑ベース)
コードハイライトテーマ選択

明暗テーマごとに、コードハイライトのテーマを指定できます。

テーマ配色確認
スクリーン表示幅
640px
80%
90%
100%

768px以上の幅があるときのドキュメント部分表示幅です。

インデント
無し
1rem
2rem
3rem
原文確認
原文を全行表示
原文を一行ずつ表示
使用しない

※ 段落末のEボタンへカーソルオンで原文をPopupします。

Diff表示形式
色分けのみで区別
行頭の±で区別
削除線と追記で区別

※ [tl!…]形式の挿入削除行の表示形式です。

テストコード表示
両コード表示
Pestのみ表示
PHPUnitのみ表示
OS表示
全OS表示
macOSのみ表示
windowsのみ表示
linuxのみ表示
JSフレームワーク
両フレームワーク
Reactのみ表示
Vueのみ表示
JSのみ表示

(JSが存在しない場合は、他を全表示)

和文変換

対象文字列と置換文字列を半角スペースで区切ってください。(最大5組各10文字まで)

本文フォント

総称名以外はCSSと同様に、"〜"でエスケープしてください。

コードフォント

総称名以外はCSSと同様に、"〜"でエスケープしてください。

保存内容リセット

localStrageに保存してある設定項目をすべて削除し、デフォルト状態へ戻します。

ヘッダー項目移動

キーボード操作