mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 21:48:42 +08:00
fix(button): adds type
This commit is contained in:
1
packages/core/src/components.d.ts
vendored
1
packages/core/src/components.d.ts
vendored
@ -413,6 +413,7 @@ declare global {
|
||||
round?: boolean;
|
||||
size?: 'small' | 'default' | 'large';
|
||||
strong?: boolean;
|
||||
type?: string;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,6 +15,13 @@ export class Button {
|
||||
|
||||
@State() keyFocus: boolean;
|
||||
|
||||
/**
|
||||
* The type of the button.
|
||||
* Possible values are: `"submit"`, `"reset"` and `"button"`.
|
||||
* Default value is: `"button"`
|
||||
*/
|
||||
@Prop() type = 'button';
|
||||
|
||||
/**
|
||||
* Contains a URL or a URL fragment that the hyperlink points to.
|
||||
* If this property is set, an anchor tag will be rendered.
|
||||
@ -123,8 +130,13 @@ export class Button {
|
||||
'focused': this.keyFocus
|
||||
};
|
||||
|
||||
const attrs = (TagType === 'button')
|
||||
? {type: 'button'}
|
||||
: {};
|
||||
|
||||
return (
|
||||
<TagType
|
||||
{...attrs}
|
||||
class={buttonClasses}
|
||||
disabled={this.disabled}
|
||||
href={this.href}
|
||||
|
@ -158,6 +158,15 @@ boolean
|
||||
If true, activates a button with a heavier font weight.
|
||||
|
||||
|
||||
#### type
|
||||
|
||||
string
|
||||
|
||||
The type of the button.
|
||||
Possible values are: `"submit"`, `"reset"` and `"button"`.
|
||||
Default value is: `"button"`
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
#### button-type
|
||||
@ -240,6 +249,15 @@ boolean
|
||||
If true, activates a button with a heavier font weight.
|
||||
|
||||
|
||||
#### type
|
||||
|
||||
string
|
||||
|
||||
The type of the button.
|
||||
Possible values are: `"submit"`, `"reset"` and `"button"`.
|
||||
Default value is: `"button"`
|
||||
|
||||
|
||||
## Events
|
||||
|
||||
#### ionBlur
|
||||
|
Reference in New Issue
Block a user