fix(filters): change code structure and data flow in filter type 1

This commit is contained in:
kur0nek-o
2024-02-09 14:24:09 +07:00
parent 62cbcc9c28
commit cb8e11b1e9
12 changed files with 838 additions and 560 deletions

View File

@@ -6,10 +6,6 @@ const props = defineProps({
type: String as () => 'button' | 'submit' | 'reset',
default: 'button'
},
onClick: {
type: Function as unknown as () => (payload: MouseEvent) => void,
default: () => {}
},
label: {
type: String,
default: ''
@@ -47,12 +43,14 @@ const buttonStyle = computed(() => {
return 'bg-none text-primary-500 border border-transparent hover:border-primary-500 rounded-lg disabled:border-primary-300 disabled:text-primary-300'
}
})
const emit = defineEmits(['on:click'])
</script>
<template>
<button
:type="type"
@click="onClick"
@click="emit('on:click')"
:disabled="isLoading ? true : disabled"
:class="['px-3 py-2 text-sm font-semibold', buttonStyle, className]"
>