api-client/components/tab/Primary.vue

86 lines
1.6 KiB
Vue
Raw Normal View History

2021-07-03 13:14:58 +00:00
<template>
<SmartLink
:to="`${/^\/(?!\/).*$/.test(to) ? localePath(to) : to}`"
:exact="exact"
:blank="blank"
class="
rounded
2021-07-17 17:40:28 +00:00
py-2
2021-08-28 05:27:21 +00:00
transition
2021-07-17 17:40:28 +00:00
px-4
2021-07-03 13:14:58 +00:00
inline-flex
items-center
truncate
focus:outline-none
"
:class="[
color
2021-08-17 07:26:36 +00:00
? `text-${color}-500 hover:text-${color}-600 focus-visible:text-${color}-600`
: 'hover:text-secondaryDark focus-visible:text-accent',
2021-07-24 16:46:48 +00:00
{ 'opacity-75 cursor-not-allowed': disabled },
2021-07-03 13:14:58 +00:00
{ 'flex-row-reverse': reverse },
]"
:disabled="disabled"
>
<i
v-if="icon"
:class="label ? (reverse ? 'ml-4 opacity-75' : 'mr-4 opacity-75') : ''"
class="material-icons"
>
{{ icon }}
</i>
<SmartIcon
v-if="svg"
:name="svg"
:class="label ? (reverse ? 'ml-4 opacity-75' : 'mr-4 opacity-75') : ''"
class="svg-icons"
/>
{{ label }}
</SmartLink>
</template>
<script>
2021-08-24 03:44:46 +00:00
import { defineComponent } from "@nuxtjs/composition-api"
export default defineComponent({
2021-07-03 13:14:58 +00:00
props: {
to: {
type: String,
default: "",
},
exact: {
type: Boolean,
default: true,
},
blank: {
type: Boolean,
default: false,
},
label: {
type: String,
default: "",
},
icon: {
type: String,
default: "",
},
svg: {
type: String,
default: "",
},
color: {
type: String,
default: "",
},
disabled: {
type: Boolean,
default: false,
},
reverse: {
type: Boolean,
default: false,
},
},
2021-08-24 03:44:46 +00:00
})
2021-07-03 13:14:58 +00:00
</script>