LoginSignup
0
0

More than 5 years have passed since last update.

ステップバイステップでLightningコンポーネントを楽しもう! - モジュール2

Last updated at Posted at 2015-09-03

コンポーネントに属性を追加してみよう

コンポーネントに属性を追加します。
コンポーネントの属性はApexクラスのメンバー属性に似ています。

画面イメージ

ソース

m02_ComponentAttribute.cmp
<aura:component implements="force:appHostable">
    <aura:attribute name="target" type="String" default="world"/>
    <h1>Hello, {!v.target}!</h1>
</aura:component>

ポイント

<aura:attribute>タグ

コンポーネントの属性です。
{!v.<属性名>}でコンポーネントから属性にアクセスできます。

値プロバイダ

  • v コンポーネントの属性セット
  • c 固有のアクションおよびイベントハンドラを含むコンポーネントのコントローラ

補足

  • P69 式
  • P245 サポートされる aura:attribute の型
  • P246 基本の型
  • P72 値プロバイダ

:arrow_backward: モジュール1へ | モジュール3へ :arrow_forward:

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0