When displaying data saved in sessionStorage
within a template, use the following approach:
<template>
<div>{{ sessionStorage.getItem('someName') }} </div>
</template>
If you have a JSON
object stored in sessionStorage
and want to display a specific property, make sure to parse it first like so:
<template>
<div>{{ JSON.parse(sessionStorage.getItem('someName')).propertyName }} </div>
</template>
Keep in mind that sessionStorage is not reactive, so any changes made to the storage after your Vue component is rendered will not be reflected in the displayed data.