mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-24 17:00:36 +01:00
@@ -4,7 +4,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<NuxtLink
|
<NuxtLink
|
||||||
v-else
|
v-else
|
||||||
v-slot="{ href, target, rel, navigate, exact, isActive, isExactActive, isExternal }"
|
v-slot="{ href, target, rel, navigate, isActive, isExactActive, isExternal }"
|
||||||
v-bind="$props"
|
v-bind="$props"
|
||||||
custom
|
custom
|
||||||
>
|
>
|
||||||
@@ -29,6 +29,10 @@ export default defineComponent({
|
|||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
props: {
|
props: {
|
||||||
...NuxtLink.props,
|
...NuxtLink.props,
|
||||||
|
exact: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
inactiveClass: {
|
inactiveClass: {
|
||||||
type: String,
|
type: String,
|
||||||
default: undefined
|
default: undefined
|
||||||
@@ -36,7 +40,11 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
setup (props) {
|
setup (props) {
|
||||||
function resolveLinkClass ({ isActive, isExactActive }: { isActive: boolean, isExactActive: boolean }) {
|
function resolveLinkClass ({ isActive, isExactActive }: { isActive: boolean, isExactActive: boolean }) {
|
||||||
if (isActive || isExactActive) {
|
if (props.exact && isExactActive) {
|
||||||
|
return props.activeClass
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!props.exact && isActive) {
|
||||||
return props.activeClass
|
return props.activeClass
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user