<el-select @change="store(types)" v-model="types" placeholder="Select">
<el-option
v-for="t in types"
:label="t.name"
:value="t"
>
</el-option>
I have implemented a method called store that saves the selected option to local storage:
store(value){
var name = value.name;
var selected = localStorage.setItem('plan', name); // String
},
Is there a way for me to retain the previously selected option when refreshing or revisiting this page using VueJS?