この文章は Salesforce 機械翻訳システムを使用して翻訳されました。詳細はこちらをご参照ください。
英語に切り替える

aura:valueChange

値が変更されたことを示します。
このイベントは、属性値が変更された場合に自動的に起動されます。aura:valueChange イベントは、クライアント側のコントローラで処理されます。コンポーネントに複数の <aura:handler name="change"> タグを設定して、さまざまな属性の変更を検出できます。
1<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})
change ハンドラには、次���必須属性があります。
属性名 説明
name String ハンドラ名。change に設定する必要があります。
value Object 変更を検出する値。
action Object 値の変更を処理するクライアント側のコントローラアクション。