2020-11-25 14:31:34 +02:00
|
|
|
<template>
|
2021-09-29 18:50:45 +03:00
|
|
|
<div class="qmfkfnzj">
|
|
|
|
<a class="main _button" :href="to" target="_blank" v-if="external">
|
2020-11-25 14:31:34 +02:00
|
|
|
<span class="icon"><slot name="icon"></slot></span>
|
|
|
|
<span class="text"><slot></slot></span>
|
|
|
|
</a>
|
2021-09-29 18:50:45 +03:00
|
|
|
<MkA class="main _button" :class="{ active }" :to="to" :behavior="behavior" v-else>
|
2020-11-25 14:31:34 +02:00
|
|
|
<span class="icon"><slot name="icon"></slot></span>
|
|
|
|
<span class="text"><slot></slot></span>
|
|
|
|
</MkA>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { defineComponent } from 'vue';
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
props: {
|
|
|
|
to: {
|
|
|
|
type: String,
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
active: {
|
|
|
|
type: Boolean,
|
|
|
|
required: false
|
|
|
|
},
|
|
|
|
external: {
|
|
|
|
type: Boolean,
|
|
|
|
required: false
|
|
|
|
},
|
2021-03-02 18:03:29 +02:00
|
|
|
behavior: {
|
|
|
|
type: String,
|
|
|
|
required: false,
|
|
|
|
},
|
2020-11-25 14:31:34 +02:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
};
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2021-09-29 18:50:45 +03:00
|
|
|
.qmfkfnzj {
|
2020-11-25 14:31:34 +02:00
|
|
|
> .main {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
width: 100%;
|
|
|
|
box-sizing: border-box;
|
2021-09-29 18:50:45 +03:00
|
|
|
padding: 10px 16px 10px 14px;
|
|
|
|
border-radius: 999px;
|
|
|
|
font-size: 0.9em;
|
2020-11-25 14:31:34 +02:00
|
|
|
|
|
|
|
&:hover {
|
|
|
|
text-decoration: none;
|
2021-09-29 18:50:45 +03:00
|
|
|
background: var(--panelHighlight);
|
2020-11-25 14:31:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
&.active {
|
|
|
|
color: var(--accent);
|
2021-09-29 18:50:45 +03:00
|
|
|
background: var(--accentedBg);
|
2020-11-25 14:31:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
> .icon {
|
|
|
|
width: 32px;
|
|
|
|
margin-right: 2px;
|
|
|
|
flex-shrink: 0;
|
|
|
|
text-align: center;
|
|
|
|
opacity: 0.8;
|
|
|
|
|
|
|
|
&:empty {
|
|
|
|
display: none;
|
|
|
|
|
|
|
|
& + .text {
|
|
|
|
padding-left: 4px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> .text {
|
|
|
|
white-space: nowrap;
|
|
|
|
text-overflow: ellipsis;
|
2021-03-02 15:57:16 +02:00
|
|
|
overflow: hidden;
|
2020-11-25 14:31:34 +02:00
|
|
|
padding-right: 12px;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .right {
|
|
|
|
margin-left: auto;
|
|
|
|
opacity: 0.7;
|
2020-12-03 16:06:46 +02:00
|
|
|
|
|
|
|
> .text:not(:empty) {
|
|
|
|
margin-right: 0.75em;
|
|
|
|
}
|
2020-11-25 14:31:34 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|