Skip to content

Commit

Permalink
chore(slider): update demo
Browse files Browse the repository at this point in the history
  • Loading branch information
novlan1 committed Jul 2, 2024
1 parent d93ffcf commit fd77e97
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions src/slider/_example/min-and-max.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'tdesign-web-components/slider';
import 'tdesign-web-components/space';

import { Component, signal } from 'omi';
import { bind, Component, signal } from 'omi';

export default class Demo extends Component {
value1 = signal(12);
Expand All @@ -17,11 +17,29 @@ export default class Demo extends Component {
30: 'max:30',
});

@bind
onChange(value) {
console.log('[change]', value);
}

render() {
return (
<t-space direction="vertical" size="60px" style={{ width: '100%' }}>
<t-slider value={this.value1.value} min={this.min.value} max={this.max.value} marks={this.marks.value} />
<t-slider range value={this.value2.value} min={this.min.value} max={this.max.value} marks={this.marks.value} />
<t-slider
value={this.value1.value}
min={this.min.value}
max={this.max.value}
marks={this.marks.value}
onChange={this.onChange}
/>
<t-slider
range
value={this.value2.value}
min={this.min.value}
max={this.max.value}
marks={this.marks.value}
onChange={this.onChange}
/>
</t-space>
);
}
Expand Down

0 comments on commit fd77e97

Please sign in to comment.