/
githubmirror
/
halo
Обзор
Документация
Войти
/
githubmirror
/
halo
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
ui/src/formkit/inputs/list/AddButton.vue
37 строк
862 B
Ryan Wang
refactor: improve button component styles (#7517)
09 июн 2025, 18:38
Не верифицирован
09 июн 2025, 18:38
204113b
Код
Авторство
О чём код?
<script lang="ts" setup> import type { FormKitFrameworkContext } from "@formkit/core"; import { IconAddCircle, VButton } from "@halo-dev/components"; import type { PropType } from "vue"; const props = defineProps({ context: { type: Object as PropType<FormKitFrameworkContext>, required: true, }, disabled: { type: Boolean, required: false, }, onClick: { type: Function as PropType<() => void>, required: true, }, }); const handleAppendClick = () => { if (!props.disabled && props.onClick) { props.onClick(); } }; </script> <template> <div :class="context.classes.add" @click="handleAppendClick"> <VButton :disabled="disabled" type="secondary"> <template #icon> <IconAddCircle /> </template> {{ context.addLabel || $t("core.common.buttons.add") }} </VButton> </div> </template>