mirror of
https://github.com/bitinflow/ui.git
synced 2026-03-13 13:45:59 +00:00
Add exact link
This commit is contained in:
@@ -22,12 +22,19 @@ export default {
|
|||||||
href: {
|
href: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '/'
|
default: '/'
|
||||||
|
},
|
||||||
|
exact: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
calculateClasses: function () {
|
calculateClasses: function () {
|
||||||
return {
|
return {
|
||||||
'router-link-active': document.location.href.includes(this.href) && this.href !== '/',
|
'router-link-active':
|
||||||
|
this.exact
|
||||||
|
? document.location.href === this.href
|
||||||
|
: document.location.href.includes(this.href) && this.href !== '/',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user