diff --git a/src/components/Button/src/BasicButton.vue b/src/components/Button/src/BasicButton.vue index c3490fde..9072c56a 100644 --- a/src/components/Button/src/BasicButton.vue +++ b/src/components/Button/src/BasicButton.vue @@ -1,13 +1,14 @@ - + diff --git a/src/components/Button/src/props.ts b/src/components/Button/src/props.ts index a50d8f4c..d2a9a5ba 100644 --- a/src/components/Button/src/props.ts +++ b/src/components/Button/src/props.ts @@ -1,6 +1,10 @@ +const validColors = ['primary', 'error', 'warning', 'success', ''] as const +type ButtonColorType = (typeof validColors)[number] + export const buttonProps = { color: { - type: String, + type: String as PropType, + validator: v => validColors.includes(v), default: '', }, loading: { type: Boolean }, diff --git a/src/views/base/login/LoginForm.vue b/src/views/base/login/LoginForm.vue index 358665f1..1e53d162 100644 --- a/src/views/base/login/LoginForm.vue +++ b/src/views/base/login/LoginForm.vue @@ -112,7 +112,10 @@ async function handleLogin(params) { - + - +