WIP(shops): more fixes
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
:right="true"
|
||||
:hide-icon="false"
|
||||
:inline-dropdown="false"
|
||||
:direct-select="directSelect"
|
||||
@select="selectItem($event)"
|
||||
>
|
||||
<template #item="{ item }">
|
||||
@@ -35,6 +36,10 @@ export default {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
directSelect: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user