Nuxt useState

You can retrieve and set temporary shared state using useState.

URI state://{key}
Path

useState key

Example state://basic

ViewState

Retrieve and Update

Specify state://{key} in the src attribute to share temporary state between components.

vue
<template>
 <ViewState
  v-slot="example"
  src="state://basic"
 >
  <b-input
   :state-src="example"
   state-path="key1"
  />
  <b-input
   :state-src="example"
   state-path="key2"
  />
  <div>{{ example.data }}</div>
 </ViewState>
</template>