refs #6416 feat: VnBtn
This commit is contained in:
parent
dfc727e813
commit
9b0613a557
|
@ -0,0 +1,33 @@
|
|||
<script setup>
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
const $props = defineProps({
|
||||
class: { type: String, require: true, default: null },
|
||||
padding: { type: String, require: true, default: null },
|
||||
color: { type: String, require: true, default: null },
|
||||
icon: { type: String, require: true, default: null },
|
||||
promise: { type: Function, require: true, default: null },
|
||||
});
|
||||
const { t } = useI18n();
|
||||
async function onClick() {
|
||||
if ($props.promise) return await $props.promise();
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<QBtn
|
||||
:class="$props.class"
|
||||
:padding="$props.padding"
|
||||
:icon="$props.icon"
|
||||
flat
|
||||
:color="$props.color"
|
||||
round
|
||||
@click="onClick()"
|
||||
>
|
||||
<QTooltip>
|
||||
<slot name="tooltip">
|
||||
{{ t('components.smartCard.downloadFile') }}
|
||||
</slot></QTooltip
|
||||
>
|
||||
</QBtn>
|
||||
</template>
|
||||
<style lang="scss" scoped></style>
|
Loading…
Reference in New Issue