I do everything for example from the official Vue.js site. But I need to use framework 7. And in input i displayed [object InputEvent]. And when I try to write some text is also displayed [object InputEvent].
How to save a name in localstorage and display it back in input?
PS v-model in framework 7 does not work
<f7-list form>
<f7-list-input
label="Username"
name="username"
placeholder="Username"
type="text"
v-bind:value="name"
required validate
pattern="[3-9a-zA-Zа-яА-ЯёЁ]+"
@input="persist"
/>
</f7-list>
<script>
export default {
data() {
return{
name: '',
}
},
mounted() {
if (localStorage.name) {
this.name = localStorage.name;
}
},
methods: {
persist(){
name=$event.target.value;
localStorage.name = this.name;
}
}
};
</script>