i'm having problems with the v-combobox. (see
Code Example).
The problem occurs if i do the following:
- Enter a string into the combobox
- Click the save button before the combobox is unfocused.
- The method save() is executed
- The console.log() returns the previous value and not the actual one.
How can i get the actual value of "value" during the execution of the save command?
<template>
<v-app>
<div id="app">
<v-card>
<v-card-text>
<v-container>
<v-combobox v-model="value" label="write"></v-combobox>
</v-container>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn text color="secondary" @click="save">save</v-btn>
</v-card-actions>
</v-card>
</div>
</v-app>
</template>
<script>
export default {
name: "App",
data() {
return {
addDialog: "false",
value: ""
};
},
methods: {
save() {
console.log(this.value);
this.addDialog = false;
}
}
};
</script>