mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-23 22:17:40 +08:00
fix(button): update button components to pass down href
This commit is contained in:
@ -12,12 +12,6 @@ import { getElementClassObject } from '../../utils/theme';
|
||||
export class ChipButton {
|
||||
@Element() private el: HTMLElement;
|
||||
|
||||
/**
|
||||
* Contains a URL or a URL fragment that the hyperlink points to.
|
||||
* If this property is set, an anchor tag will be rendered.
|
||||
*/
|
||||
@Prop() href: string;
|
||||
|
||||
/**
|
||||
* The color to use.
|
||||
* Default options are: `"primary"`, `"secondary"`, `"danger"`, `"light"`, and `"dark"`.
|
||||
@ -30,15 +24,21 @@ export class ChipButton {
|
||||
*/
|
||||
@Prop() mode: 'ios' | 'md';
|
||||
|
||||
/**
|
||||
* If true, sets the button into a disabled state.
|
||||
*/
|
||||
@Prop() disabled = false;
|
||||
|
||||
/**
|
||||
* Set to `"clear"` for a transparent button style.
|
||||
*/
|
||||
@Prop() fill: string;
|
||||
|
||||
/**
|
||||
* If true, sets the button into a disabled state.
|
||||
* Contains a URL or a URL fragment that the hyperlink points to.
|
||||
* If this property is set, an anchor tag will be rendered.
|
||||
*/
|
||||
@Prop() disabled = false;
|
||||
@Prop() href: string;
|
||||
|
||||
/**
|
||||
* Get the classes based on the button type
|
||||
@ -97,11 +97,14 @@ export class ChipButton {
|
||||
};
|
||||
|
||||
return (
|
||||
<TagType class={buttonClasses} disabled={this.disabled}>
|
||||
<span class='button-inner'>
|
||||
<slot></slot>
|
||||
</span>
|
||||
{ this.mode === 'md' && <ion-ripple-effect useTapClick={true} /> }
|
||||
<TagType
|
||||
class={buttonClasses}
|
||||
disabled={this.disabled}
|
||||
href={this.href}>
|
||||
<span class='button-inner'>
|
||||
<slot></slot>
|
||||
</span>
|
||||
{ this.mode === 'md' && <ion-ripple-effect useTapClick={true} /> }
|
||||
</TagType>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user