big update

This commit is contained in:
2023-07-27 15:36:52 +03:00
parent 6179e53af7
commit 154cfcfae1
17 changed files with 319 additions and 119 deletions

View File

@@ -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>