No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
aura:valueChange
値が変更されたことを示します。
このイベントは、属性値が変更された場合に自動的に起動されます。aura:valueChange イベントは、クライアント側のコントローラで処理されます。コンポーネントに複数の <aura:handler name="change"> タグを設定して、さまざまな属性の変更を検出できます。
change ハンドラには、次の必須属性があります。
1swfobject.registerObject("clippy.codeblock-0", "9");<aura:handler name="change" value="{!v.items}" action="{!c.itemsChange}"/>次の例に、aura:valueChange イベントを自動的に起動する Boolean 値の更新を示します。
1<aura:component>
2 <aura:attribute name="myBool" type="Boolean" default="true"/>
3
4 <!-- Handles the aura:valueChange event -->
5 <aura:handler name="change" value="{!v.myBool}" action="{!c.handleValueChange}"/>
6 <ui:button label="change value" press="{!c.changeValue}"/>
7</aura:component>次のクライアント側のコントローラアクションは、値の変更をトリガし、それを処理します。
1({
2 changeValue : function (component, event, helper) {
3 component.set("v.myBool", false);
4 },
5
6 handleValueChange : function (component, event, helper) {
7 //handle value change
8 }
9})| 属性名 | 型 | 説明 |
|---|---|---|
| name | String | ハンドラ���。change に設定する必要があります。 |
| value | Object | 変更を検出する値。 |
| action | Object | 値の変更を処理するクライアント側のコントローラアクション。 |