big update
This commit is contained in:
@@ -1,19 +1,29 @@
|
||||
<script setup lang="ts">
|
||||
import type { TColor } from '../colors'
|
||||
import type { TUiIcon } from '../icons'
|
||||
|
||||
import UiIcon from './Icon.vue'
|
||||
|
||||
// Props.
|
||||
const props = defineProps<{
|
||||
label?: string
|
||||
type?: 'button' | 'submit'
|
||||
color?: string
|
||||
icon?: any
|
||||
color?: TColor
|
||||
icon?: TUiIcon
|
||||
to?: string
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<button class="ui-btn" :class="props.color" :type="props.type">
|
||||
<component
|
||||
class="ui-btn"
|
||||
:is="props.to ? 'router-link' : 'button'"
|
||||
:to="props.to"
|
||||
:class="props.color"
|
||||
:type="props.type"
|
||||
>
|
||||
<ui-icon v-if="props.icon" :name="props.icon" />
|
||||
<div v-if="props.label" class="label">{{ props.label }}</div>
|
||||
<slot v-if="$slots.default" name="default" />
|
||||
</button>
|
||||
</component>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user