mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
31 lines
592 B
TypeScript
31 lines
592 B
TypeScript
import { Component, ComponentInterface, Host, Prop, h } from '@stencil/core';
|
|
|
|
import { getIonMode } from '../../global/ionic-global';
|
|
|
|
@Component({
|
|
tag: 'ion-grid',
|
|
styleUrl: 'grid.scss',
|
|
shadow: true
|
|
})
|
|
export class Grid implements ComponentInterface {
|
|
|
|
/**
|
|
* If `true`, the grid will have a fixed width based on the screen size.
|
|
*/
|
|
@Prop() fixed = false;
|
|
|
|
render() {
|
|
const mode = getIonMode(this);
|
|
return (
|
|
<Host
|
|
class={{
|
|
[mode]: true,
|
|
'grid-fixed': this.fixed
|
|
}}
|
|
>
|
|
<slot></slot>
|
|
</Host>
|
|
);
|
|
}
|
|
}
|