ion-text

概要(CONTENTS)

Ionic4项目中我们可以使用Ionic4组件ion-text对项目进行布局。ion-text中有ionic ion-text 用法(Usage) ,ionic ion-text 属性(Properties)等

The text component is a simple component that can be used to style the text color of any element. The ion-text element should wrap the element in order to change the text color of that element.

ion-text 用法(Usage)

javascript
<ion-text color="secondary">
  <h1>H1: The quick brown fox jumps over the lazy dogh1>
ion-text>

<ion-text color="primary">
  <h2>H2: The quick brown fox jumps over the lazy dogh2>
ion-text>

<ion-text color="light">
  <h3>H3: The quick brown fox jumps over the lazy dogh3>
ion-text>

<ion-text color="danger">
  <h4 >H4: The quick brown fox jumps over the lazy dogh4>
ion-text>

<ion-text color="dark">
  <h5>H5: The quick brown fox jumps over the lazy dogh5>
ion-text>

<p>
  I saw a werewolf with a Chinese menu in his hand.
  Walking through the <ion-text color="danger"><sub>streetssub>ion-text> of Soho in the rain.
  He <ion-text color="primary"><i>wasi>ion-text> looking for a place called Lee Ho Fook's.
  Gonna get a <ion-text color="secondary"><a>big dish of beef chow mein.a>ion-text>
  <ion-text color="danger"><ion-icon name="cut">ion-icon>ion-text>
p>

ion-text 属性(Properties)

color

Description

The color to use from your application's color palette. Default options are: "primary", "secondary", "tertiary", "success", "warning", "danger", "light", "medium", and "dark". For more information on colors, see theming.

Attribute color
Type string | undefined

mode

Description

The mode determines which platform styles to use.

Attribute mode
Type "ios" | "md"