From 2f11b8fbd52be2721cd3d9d619fba0451343eb2e Mon Sep 17 00:00:00 2001 From: shamilfrontend Date: Mon, 16 May 2022 13:12:57 +0300 Subject: [PATCH] fix: by comments --- src/qComponents/QButton/index.ts | 3 +-- src/qComponents/QButton/src/QButton.vue | 18 +++++++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/qComponents/QButton/index.ts b/src/qComponents/QButton/index.ts index 53ebf9ff..0b1b24a4 100644 --- a/src/qComponents/QButton/index.ts +++ b/src/qComponents/QButton/index.ts @@ -15,6 +15,5 @@ export type { QButtonPropDisabled, QButtonPropAutofocus, QButtonPropCircle, - QButtonPropFullWidth, - QButtonInstance + QButtonPropFullWidth } from './src/types'; diff --git a/src/qComponents/QButton/src/QButton.vue b/src/qComponents/QButton/src/QButton.vue index 4205f4c3..edf4781a 100644 --- a/src/qComponents/QButton/src/QButton.vue +++ b/src/qComponents/QButton/src/QButton.vue @@ -11,7 +11,7 @@ class="q-icon-reverse" /> , - default: 'default', + default: defaultPropTypeValue, validator: validateArray(['default', 'icon']) }, theme: { type: String as PropType, - default: 'primary', + default: defaultPropThemeValue, validator: validateArray([ 'primary', 'secondary', @@ -70,7 +74,7 @@ export default /* #__PURE__ */ defineComponent({ size: { type: String as PropType, - default: 'medium', + default: defaultPropSizeValue, validator: validateArray(['small', 'medium']) }, @@ -147,9 +151,9 @@ export default /* #__PURE__ */ defineComponent({ const classList = computed(() => { const classes: ClassValue[] = Object.entries({ - theme: props.theme, - type: props.type, - size: props.size + theme: props.theme ?? defaultPropThemeValue, + type: props.type ?? defaultPropTypeValue, + size: props.size ?? defaultPropSizeValue }) .filter(([, value]) => Boolean(value)) .map(([key, value]) => `q-button_${key}_${value}`);