WIP(shops): more fixes

This commit is contained in:
Sabe Jones
2024-05-17 20:29:14 -05:00
parent 3bb1cceed1
commit 8d479e358d
10 changed files with 94 additions and 136 deletions

View File

@@ -104,6 +104,10 @@ export default {
activeKeyProp: {
type: String,
},
directSelect: {
type: Boolean,
default: false,
},
disabledProp: {
type: String,
},
@@ -132,13 +136,17 @@ export default {
},
methods: {
getKeyProp (item) {
return this.keyProp ? item[this.keyProp] : item.key;
return this.keyProp ? item[this.keyProp] : item.key || item.identifier;
},
isDisabled (item) {
return typeof item[this.disabledProp] === 'undefined' ? false : item[this.disabledProp];
},
selectItem (item) {
this.selected = this.getKeyProp(item);
if (this.directSelect) {
this.selected = item;
} else {
this.selected = this.getKeyProp(item);
}
this.$emit('select', item);
},
isSelected (item) {