Nuxt useState

On this page

How it works

State URI

URI state://{**name}
Scheme state
Path 値のキー文字列を指定します。/を含めた場合も文字全体がキーにになります。
Example state://basic/test

Example

Basic usage

vue
<template>
  <c-input state-src="state://basic" />
  <c-label state-src="state://basic" />
</template>

State Path

vue
<template>
  <c-input state-src="state://pathsample" state-path="prop1" />
  <c-input state-src="state://pathsample" state-path="prop2" />
  <c-label state-src="state://pathsample" />
</template>

Action link

vue
<template>
  <c-input state-src="state://basic" />
  <c-label state-src="state://basic" />
  <div>
    <c-link
      state-src="state://basic"
      state-to="Set Value"
    >
      [ Set Value ]
    </c-link>
  </div>
</template>