push active-id to tree-items for highlighting
This commit is contained in:
@@ -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))
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user