mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-24 14:58:36 +08:00
fix(): update to Stencil One 🎉🎊
This commit is contained in:
@ -1,8 +1,12 @@
|
||||
import { Component, ComponentInterface, Element, Event, EventEmitter, Listen, Prop, Watch } from '@stencil/core';
|
||||
|
||||
import { Color, Mode, SegmentChangeEventDetail, StyleEventDetail } from '../../interface';
|
||||
import { getIonMode } from '../../global/ionic-global';
|
||||
import { Color, SegmentChangeEventDetail, StyleEventDetail } from '../../interface';
|
||||
import { createColorClasses } from '../../utils/theme';
|
||||
|
||||
/**
|
||||
* @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use.
|
||||
*/
|
||||
@Component({
|
||||
tag: 'ion-segment',
|
||||
styleUrls: {
|
||||
@ -22,11 +26,6 @@ export class Segment implements ComponentInterface {
|
||||
*/
|
||||
@Prop() color?: Color;
|
||||
|
||||
/**
|
||||
* The mode determines which platform styles to use.
|
||||
*/
|
||||
@Prop() mode!: Mode;
|
||||
|
||||
/**
|
||||
* If `true`, the user cannot interact with the segment.
|
||||
*/
|
||||
@ -96,10 +95,11 @@ export class Segment implements ComponentInterface {
|
||||
}
|
||||
|
||||
hostData() {
|
||||
const mode = getIonMode(this);
|
||||
return {
|
||||
class: {
|
||||
...createColorClasses(this.color),
|
||||
[`${this.mode}`]: true,
|
||||
[`${mode}`]: true,
|
||||
'segment-disabled': this.disabled,
|
||||
'segment-scrollable': this.scrollable
|
||||
}
|
||||
|
Reference in New Issue
Block a user