You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
923 B
48 lines
923 B
<template> |
|
<component :is="tag" |
|
@click.native="hideSidebar" |
|
v-bind="$attrs" |
|
tag="li"> |
|
<a class="nav-link"> |
|
<slot> |
|
<i v-if="link.icon" :class="link.icon"></i> |
|
<p>{{link.name}}</p> |
|
</slot> |
|
</a> |
|
</component> |
|
</template> |
|
<script> |
|
export default { |
|
inheritAttrs: false, |
|
inject: { |
|
autoClose: { |
|
default: true |
|
} |
|
}, |
|
props: { |
|
link: { |
|
type: [String, Object], |
|
default: () => { |
|
return { |
|
name: '', |
|
path: '', |
|
icon: '' |
|
} |
|
} |
|
}, |
|
tag: { |
|
type: String, |
|
default: 'router-link' |
|
} |
|
}, |
|
methods: { |
|
hideSidebar () { |
|
if (this.autoClose && this.$sidebar && this.$sidebar.showSidebar === true) { |
|
this.$sidebar.displaySidebar(false) |
|
} |
|
} |
|
} |
|
} |
|
</script> |
|
<style> |
|
</style>
|
|
|