I have a Vue/Vuetify page that uses a dialog to collect data to submit. It's a big page so I don't want to post the entire file if possible. The problem I am seeing is that the v-model value isn't picked up.
<template>
<div class="px-10 ma-10 grey lighten-5">
<v-dialog v-model="scannedDialog" width="600">
<v-card auto-grow>
<v-card-title class="headline blue" primary-title>
Update Scanned Device
</v-card-title>
<v-card-text class="pa-5">
<v-form ref="sendForm" v-model="scannedvalid">
<v-text-field
v-model="selectedScannedDevice.scannedDeviceId"
label="Scanned Internal Id *"
:rules="[rules.required]"
>
</v-text-field>
<v-text-field
v-model="selectedScannedDevice.firstName"
label="First Name *"
:rules="[rules.required]">
</v-text-field>
</v-form>
</v-card-text>
<v-card-actions class="pa-5">
<v-btn
class="ml-auto"
@click="cancelScannedDevice"
outlined
color="primary">
Cancel
</v-btn>
<v-btn
class="ml-auto"
@click="saveScannedDevice"
outlined
:disabled="!scannedvalid"
color="primary">
Save
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</div>
</template>
<script>
export default {
data() {
return {
selectedScannedDevice: [],
....
};
},
methods: {
async saveScannedDevice() {
console.log( "saveScannedDevice starting with form: " + JSON.stringify(this.selectedScannedDevice)
);
...}
</script>
When I run this, the saveScannedDevice always has the result: saveScannedDevice starting with form: []
I cannot find any parsing/formatting errors, but this.selectedScannedDevice never seems to have values in it.