I have a Vuetify Datatable
with inline editing using <v-edit-dialog>
components.
The Calories column values are numbers, but when I edit them, they are converted to strings by default and I want them to stay as numbers. For example If I change Frozen Yogurt Calories from 159 to 30, the value becomes the string "30".
Code Snippet
<td>
<v-edit-dialog
:return-value.sync="props.item.calories"
lazy
@save="save"
> {{ props.item.calories }}
<v-text-field
type="number"
slot="input"
v-model.number="props.item.calories"
label="Edit"
single-line
></v-text-field>
</v-edit-dialog>
</td>
I thought that using v-model.number
and the type=number
would solve the problem, but it's still happening.
This is a pen where you can reproduce my issue:
.sync
modifier? – Traxo.sync
modifier? Any side effects? – Traxo.sync
fixes the issue. – SnakeyHips