|
@@ -1,5 +1,12 @@
|
|
|
+const validColors = ['error', 'warning', 'success', ''] as const;
|
|
|
+type ButtonColorType = typeof validColors[number];
|
|
|
+
|
|
|
export const buttonProps = {
|
|
|
- color: { type: String, validator: (v) => ['error', 'warning', 'success', ''].includes(v) },
|
|
|
+ color: {
|
|
|
+ type: String as PropType<ButtonColorType>,
|
|
|
+ validator: (v) => validColors.includes(v),
|
|
|
+ default: '',
|
|
|
+ },
|
|
|
loading: { type: Boolean },
|
|
|
disabled: { type: Boolean },
|
|
|
/**
|