mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Added matcher prop for menu
This commit is contained in:
parent
1cb4156422
commit
598dd9cda7
@ -98,6 +98,15 @@ export default {
|
||||
return route.name
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Function that matches items exactly
|
||||
*/
|
||||
matcher: {
|
||||
type: Function,
|
||||
default: () => {
|
||||
return false
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Function that checks if the url must be matched exactly in order to activate the menu item. By default only '/' must be matched exactly.
|
||||
*/
|
||||
|
||||
@ -14,6 +14,9 @@
|
||||
<component
|
||||
v-if="route"
|
||||
class="ds-menu-item-link"
|
||||
:class="[
|
||||
matcher && 'router-link-exact-active'
|
||||
]"
|
||||
v-bind="bindings"
|
||||
:exact="isExact"
|
||||
:is="linkTag"
|
||||
@ -106,6 +109,9 @@ export default {
|
||||
isExact() {
|
||||
return this.$parentMenu.isExact(this.url)
|
||||
},
|
||||
matcher() {
|
||||
return this.$parentMenu.matcher(this.url, this.route)
|
||||
},
|
||||
level() {
|
||||
return this.parents.length
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user