type error when I custom css to my button #7182
-
I have been using css below to custom native button element .ui-button[type="primary"]{} so this should be work <button type="primary"></button> but volar gives me a error like the type define is in export interface ButtonHTMLAttributes extends HTMLAttributes {
autofocus?: Booleanish
disabled?: Booleanish
form?: string
formaction?: string
formenctype?: string
formmethod?: string
formnovalidate?: Booleanish
formtarget?: string
name?: string
type?: 'submit' | 'reset' | 'button'
value?: string | string[] | number
} and the error is understandable, so I want to merge interface. declare module "@vue/runtime-dom" {
export interface ButtonHTMLAttributes extends HTMLAttributes {
type?:
| "normal"
| "primary"
| "remind"
| "success"
| "danger"
| "error"
| "submit";
}
} there is another error coming is there a solution for me to fix it? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The error is because the button tag's type attribute is one of 'submit' | 'reset' | 'button' or don't provide. I suggest use other attribute such as: <button class="ui-button" btntype="primary"></button> .ui-button[btntype="primary"]{
} |
Beta Was this translation helpful? Give feedback.
The error is because the button tag's type attribute is one of 'submit' | 'reset' | 'button' or don't provide.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type
I suggest use other attribute such as: