WebクライアントLocal Storageを利用して共有状態を取得・設定、保管できます。
ブラウザの Local Storage から状態を取得します。
URI | local-storage//{**name} |
---|---|
Scheme | local-storage |
Path | 値のキー文字列を指定します。/を含めた場合も文字全体がキーにになります。 |
Example | local-storage://basic/test |
StateSrc 属性に Session Storage URI を指定して、複数のコンポーネントで状態を共有します
ブラウザの更新でも値が保持されることを確認してください。
<template>
<c-input state-src="local-storage://basic" />
<c-label state-src="local-storage://basic" />
</template>
<script setup>
</script>