fix: improve buttons (#2666)
improve buttons Co-authored-by: anhhna <anhhna@gmail.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
<input
|
<input
|
||||||
:value="label"
|
:value="label"
|
||||||
:type="type ?? 'button'"
|
:type="type ?? 'button'"
|
||||||
class="col-span-2 rounded-lg border-2 border-red-800 bg-red-800 py-2 text-white hover:border-red-600 hover:bg-red-600 focus:border-red-800 focus:outline-0 focus:ring-0"
|
class="col-span-2 rounded-lg border-2 border-red-800 bg-red-800 px-4 py-2 text-white hover:border-red-600 hover:bg-red-600 focus:border-red-800 focus:outline-0 focus:ring-0"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,32 @@
|
|||||||
<template>
|
<template>
|
||||||
<BaseFormSecondaryButton
|
<BaseFormSecondaryButton
|
||||||
as="input"
|
:as="as"
|
||||||
:value="label"
|
:value="isInput ? label : undefined"
|
||||||
:type="type ?? 'button'"
|
:type="isInput ? type : undefined"
|
||||||
class="col-span-2 py-2"
|
class="col-span-2 px-4 py-2"
|
||||||
/>
|
>
|
||||||
|
<template v-if="!isInput">
|
||||||
|
{{ label }}
|
||||||
|
</template>
|
||||||
|
</BaseFormSecondaryButton>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { InputTypeHTMLAttribute } from 'vue';
|
import type { InputTypeHTMLAttribute } from 'vue';
|
||||||
|
|
||||||
defineProps<{
|
const props = withDefaults(
|
||||||
|
defineProps<{
|
||||||
label: string;
|
label: string;
|
||||||
type?: InputTypeHTMLAttribute;
|
type?: InputTypeHTMLAttribute;
|
||||||
}>();
|
as?: string;
|
||||||
|
}>(),
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
as: 'input',
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
const isInput = computed(() => {
|
||||||
|
return props.as === 'input';
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -145,8 +145,8 @@
|
|||||||
>
|
>
|
||||||
<FormSecondaryActionField
|
<FormSecondaryActionField
|
||||||
:label="$t('admin.interface.changeCidr')"
|
:label="$t('admin.interface.changeCidr')"
|
||||||
class="w-full"
|
class="inline-block w-full"
|
||||||
tabindex="-1"
|
as="span"
|
||||||
/>
|
/>
|
||||||
</AdminCidrDialog>
|
</AdminCidrDialog>
|
||||||
<AdminRestartInterfaceDialog
|
<AdminRestartInterfaceDialog
|
||||||
@@ -155,8 +155,8 @@
|
|||||||
>
|
>
|
||||||
<FormSecondaryActionField
|
<FormSecondaryActionField
|
||||||
:label="$t('admin.interface.restart')"
|
:label="$t('admin.interface.restart')"
|
||||||
class="w-full"
|
class="inline-block w-full"
|
||||||
tabindex="-1"
|
as="span"
|
||||||
/>
|
/>
|
||||||
</AdminRestartInterfaceDialog>
|
</AdminRestartInterfaceDialog>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
|
|||||||
@@ -188,9 +188,7 @@
|
|||||||
>
|
>
|
||||||
<FormSecondaryActionField
|
<FormSecondaryActionField
|
||||||
:label="$t('client.delete')"
|
:label="$t('client.delete')"
|
||||||
class="w-full"
|
class="inline-block w-full"
|
||||||
type="button"
|
|
||||||
tabindex="-1"
|
|
||||||
as="span"
|
as="span"
|
||||||
/>
|
/>
|
||||||
</ClientsDeleteDialog>
|
</ClientsDeleteDialog>
|
||||||
@@ -200,9 +198,7 @@
|
|||||||
>
|
>
|
||||||
<FormSecondaryActionField
|
<FormSecondaryActionField
|
||||||
:label="$t('client.viewConfig')"
|
:label="$t('client.viewConfig')"
|
||||||
class="w-full"
|
class="inline-block w-full"
|
||||||
type="button"
|
|
||||||
tabindex="-1"
|
|
||||||
as="span"
|
as="span"
|
||||||
/>
|
/>
|
||||||
</ClientsConfigDialog>
|
</ClientsConfigDialog>
|
||||||
|
|||||||
Reference in New Issue
Block a user