No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
スーパーコンポーネントから継承される属性の設定
継承される属性の値を設定するには、サブコンポーネントのマークアップで <aura:set> を使用します。
例を見てみましょう。これは docsample:setTagSuper コンポーネントです。
1swfobject.registerObject("clippy.codeblock-0", "9");<!--docsample:setTagSuper-->
2<aura:component extensible="true">
3 <aura:attribute name="address1" type="String" />
4 setTagSuper address1: {!v.address1}<br/>
5</aura:component>
6docsample:setTagSuper の出力は、次のようになります。
1setTagSuper address1:address1 属性は設定されていないため、まだ値は出力されません。
これは docsample:setTagSuper を拡張する docsample:setTagSub コンポーネントです。
1swfobject.registerObject("clippy.codeblock-2", "9");<!--docsample:setTagSub-->
2<aura:component extends="docsample:setTagSuper">
3 <aura:set attribute="address1" value="808 State St" />
4</aura:component>
5docsample:setTagSub の出力は、次のようになります。
1setTagSuper address1: 808 State StsampleSetTagExdocsample:setTagSub は、スーパーコンポーネント docsample:setTagSuper から継承される address1 属性の値を設定します。
使用コンポーネント内で参照することによってコンポーネントを使用している場合、マークアップでその属性値を直接設定できます。たとえば、docsample:setTagSuperRef は docsample:setTagSuper を参照し、aura:set を使用せずに address1 属性を直接設定します。
1swfobject.registerObject("clippy.codeblock-4", "9");<!--docsample:setTagSuperRef-->
2<aura:component>
3 <docsample:setTagSuper address1="1 Sesame St" />
4</aura:component>
5docsample:setTagSuperRef の出力は、次のようになります。
1swfobject.registerObject("clippy.codeblock-5", "9");setTagSuper address1: 1 Sesame St
2