mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-09 08:09:32 +08:00
lint(eslint): migrate to eslint and prettier (#25046)
This commit is contained in:
@ -1,8 +1,9 @@
|
||||
import { Component, ComponentInterface, Element, Host, Prop, h } from '@stencil/core';
|
||||
import type { ComponentInterface } from '@stencil/core';
|
||||
import { Component, Element, Host, Prop, h } from '@stencil/core';
|
||||
|
||||
import { getIonMode } from '../../global/ionic-global';
|
||||
import { Color } from '../../interface';
|
||||
import { AnchorInterface, ButtonInterface } from '../../utils/element-interface';
|
||||
import type { Color } from '../../interface';
|
||||
import type { AnchorInterface, ButtonInterface } from '../../utils/element-interface';
|
||||
import { createColorClasses } from '../../utils/theme';
|
||||
|
||||
/**
|
||||
@ -21,12 +22,11 @@ import { createColorClasses } from '../../utils/theme';
|
||||
tag: 'ion-item-option',
|
||||
styleUrls: {
|
||||
ios: 'item-option.ios.scss',
|
||||
md: 'item-option.md.scss'
|
||||
md: 'item-option.md.scss',
|
||||
},
|
||||
shadow: true
|
||||
shadow: true,
|
||||
})
|
||||
export class ItemOption implements ComponentInterface, AnchorInterface, ButtonInterface {
|
||||
|
||||
@Element() el!: HTMLElement;
|
||||
|
||||
/**
|
||||
@ -83,19 +83,20 @@ export class ItemOption implements ComponentInterface, AnchorInterface, ButtonIn
|
||||
if (el) {
|
||||
ev.preventDefault();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { disabled, expandable, href } = this;
|
||||
const TagType = href === undefined ? 'button' : 'a' as any;
|
||||
const TagType = href === undefined ? 'button' : ('a' as any);
|
||||
const mode = getIonMode(this);
|
||||
const attrs = (TagType === 'button')
|
||||
? { type: this.type }
|
||||
: {
|
||||
download: this.download,
|
||||
href: this.href,
|
||||
target: this.target
|
||||
};
|
||||
const attrs =
|
||||
TagType === 'button'
|
||||
? { type: this.type }
|
||||
: {
|
||||
download: this.download,
|
||||
href: this.href,
|
||||
target: this.target,
|
||||
};
|
||||
|
||||
return (
|
||||
<Host
|
||||
@ -104,15 +105,10 @@ export class ItemOption implements ComponentInterface, AnchorInterface, ButtonIn
|
||||
[mode]: true,
|
||||
'item-option-disabled': disabled,
|
||||
'item-option-expandable': expandable,
|
||||
'ion-activatable': true
|
||||
'ion-activatable': true,
|
||||
})}
|
||||
>
|
||||
<TagType
|
||||
{...attrs}
|
||||
class="button-native"
|
||||
part="native"
|
||||
disabled={disabled}
|
||||
>
|
||||
<TagType {...attrs} class="button-native" part="native" disabled={disabled}>
|
||||
<span class="button-inner">
|
||||
<slot name="top"></slot>
|
||||
<div class="horizontal-wrapper">
|
||||
|
||||
Reference in New Issue
Block a user