TrackBar 轨道条
#
例子#
基本用法export function App() { return ( <Window> <DemoLayout width="500dpx" height="25dpx"> <TrackBar onThumbRelease={(sender) => { console.log( `on thumb release, current value: ${sender.GetValue()}`, ); }} ></TrackBar> </DemoLayout> </Window> );}
在这个例子中,我们演示了轨道条的基本用法:拖动滑块以获取对应位置的值:
同时控制台还有类似这样的输出:
on thumb release, current value: 0on thumb release, current value: 22on thumb release, current value: 46on thumb release, current value: 69on thumb release, current value: 75on thumb release, current value: 85on thumb release, current value: 100...
#
APIexport interface ITrackBarComponentProps extends IComponentProps { onThumbRelease?: Parameters<ITrackBar['OnThumbRelease']>[0];}