if (config == null) config = {}
const {segmentStyle, segments, selectedIndex, change} = config
this.type = 'segmented_control'
- this._addLiveProperty('segmentStyle', segmentStyle);
- this._addLiveProperty('segments', segments || []);
+ this._addLiveProperty('segmentStyle', segmentStyle)
+ this._addLiveProperty('segments', segments || [])
this._addLiveProperty('selectedIndex', selectedIndex)
if (typeof change === 'function') {
this.onInteraction = (details) => {
- this._selectedIndex = details.selectedIndex;
- change(details.selectedIndex);
+ this._selectedIndex = details.selectedIndex
+ change(details.selectedIndex)
}
}
}