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;
|
round?: boolean;
|
||||||
size?: 'small' | 'default' | 'large';
|
size?: 'small' | 'default' | 'large';
|
||||||
strong?: boolean;
|
strong?: boolean;
|
||||||
|
type?: string;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,13 @@ export class Button {
|
|||||||
|
|
||||||
@State() keyFocus: boolean;
|
@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.
|
* Contains a URL or a URL fragment that the hyperlink points to.
|
||||||
* If this property is set, an anchor tag will be rendered.
|
* If this property is set, an anchor tag will be rendered.
|
||||||
@ -123,8 +130,13 @@ export class Button {
|
|||||||
'focused': this.keyFocus
|
'focused': this.keyFocus
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const attrs = (TagType === 'button')
|
||||||
|
? {type: 'button'}
|
||||||
|
: {};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TagType
|
<TagType
|
||||||
|
{...attrs}
|
||||||
class={buttonClasses}
|
class={buttonClasses}
|
||||||
disabled={this.disabled}
|
disabled={this.disabled}
|
||||||
href={this.href}
|
href={this.href}
|
||||||
|
@ -158,6 +158,15 @@ boolean
|
|||||||
If true, activates a button with a heavier font weight.
|
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
|
## Attributes
|
||||||
|
|
||||||
#### button-type
|
#### button-type
|
||||||
@ -240,6 +249,15 @@ boolean
|
|||||||
If true, activates a button with a heavier font weight.
|
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
|
## Events
|
||||||
|
|
||||||
#### ionBlur
|
#### ionBlur
|
||||||
|
Reference in New Issue
Block a user