push active-id to tree-items for highlighting

This commit is contained in:
2020-09-18 14:04:48 +02:00
parent 1ae3c33965
commit b6278ca291
2 changed files with 6 additions and 2 deletions
@@ -23,6 +23,10 @@
value: {
type: Object,
required: true
},
activeId: {
type: String,
default: null
}
},
@@ -59,7 +63,7 @@
'is-open': item.isOpen,
'is-selected': item.isSelected,
'is-disabled': item.disabled,
'is-active': this.isLink && (item.id == this.$route.params.id || (item.url && !item.url.params && item.url.name === this.$route.name))
'is-active': this.isLink && ((!!item.id && item.id === this.activeId) || item.id == this.$route.params.id || (item.url && !item.url.params && item.url.name === this.$route.name))
};
},
+1 -1
View File
@@ -6,7 +6,7 @@
<slot></slot>
<span v-if="status === 'loading'" class="ui-tree-item-loading"><i></i></span>
<template v-for="item in items">
<ui-tree-item :value="item" @rightclick="onRightClicked" @click="onSelect(item, $event)" @actions="onActionsClicked" @open="toggle" />
<ui-tree-item :value="item" @rightclick="onRightClicked" @click="onSelect(item, $event)" @actions="onActionsClicked" @open="toggle" :active-id="active" />
<ui-tree v-if="item.hasChildren && item.isOpen && status != 'loading'" :get="get" :parent="item.id" :depth="depth + 1" :active="active" @select="onSelect">
<template v-slot:actions="props">
<slot name="actions" v-bind="props"></slot>