Closed
Description
I'm using the following code:
<CSelect label="Druckername:"
:options="allPrinters"
:value.sync="localClientSettings.printerAddress" />
await this.$http.get('Settings/Printers').then(d => {
// Service returns an array of strings
const printerList = d.data.map(n => ({ value: n }));
printerList.unshift({ label: 'Keiner', value: null });
this.allPrinters = printerList;
});
As soon as I add the "Keiner" entry (which should represent a non-selection), vue writes an error into the console:
vue.esm.js?a026:628 [Vue warn]: Invalid prop: type check failed for prop "value". Expected String, Number, Boolean, Array, got Object
Also, I would expect the value of localClientSettings.printerAddress
to be changed to null. Instead it's getting changed to { label: 'Keiner', value: null }
, which is the object I've added to my options array.
Why does that happen? Is that a bug?
Metadata
Metadata
Assignees
Labels
No labels