Skip to content

Commit

Permalink
fix(slider): 更改事件命名
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisLee0211 authored and PengYYYYY committed May 1, 2022
1 parent e3e51a6 commit 66fa54a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/slider/hooks/useSliderMark.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const useSliderMark = (config: Ref<useSliderMarkProps>) => {
point={item.point}
key={key}
style={getStopStyle(item.position, config.value.vertical)}
clickMarkPoint={onChangeFn}
onClickMarkPoint={onChangeFn}
/>
))}
</div>
Expand Down
6 changes: 2 additions & 4 deletions src/slider/slider-mark.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default defineComponent({
point: {
type: Number,
},
clickMarkPoint: {
onClickMarkPoint: {
type: Function,
default: () => {},
},
Expand All @@ -20,9 +20,7 @@ export default defineComponent({
const COMPONENT_NAME = usePrefixClass('slider__mark');
const changeValue = (e: MouseEvent) => {
e.stopPropagation();
if (props.clickMarkPoint) {
props.clickMarkPoint(props.point);
}
props?.onClickMarkPoint?.(props.point);
};

return () => (
Expand Down

0 comments on commit 66fa54a

Please sign in to comment.