Skip to content

Commit

Permalink
feat(components): add a silder hover switch about highlight date
Browse files Browse the repository at this point in the history
ISSUES CLOSED: #29
  • Loading branch information
jeremyjone committed Jun 29, 2022
1 parent 0224cf8 commit 9ab0ebf
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
6 changes: 6 additions & 0 deletions docs/docs/slider.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@

设置滑块样式是否扁平化。

### highlightDate <Badge text="+v1.0.2" type="tip" />

<DataParameter t="Boolean" d="false" />

允许鼠标悬停高亮表头对应日期

### label

<DataParameter t="String" />
Expand Down
1 change: 1 addition & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
:linked-resize="true"
progress
progress-decimal
highlight-date
>
<!-- <template v-slot="data">
<div>{{ data.name }}</div>
Expand Down
9 changes: 6 additions & 3 deletions src/components/slider/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ const {
resizeRight,
linkedResize,
progress,
progressDecimal
progressDecimal,
highlightDate
} = toRefs(props);
const { oneDayWidth, GtParam } = useParam();
Expand Down Expand Up @@ -268,8 +269,10 @@ const { addShowDate, clearShowDateList } = useShowDate();
function onMouseEnter() {
showProgressBtn.value = true;
addShowDate(data.start);
addShowDate(data.end);
if (highlightDate.value) {
addShowDate(data.start);
addShowDate(data.end);
}
if (!canMove.value) return;
showCtrlChunk.value = true;
Expand Down
8 changes: 8 additions & 0 deletions src/components/slider/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,13 @@ export default {
}
return true;
}
},

/**
* 允许鼠标悬停高亮表头对应日期
*/
highlightDate: {
type: Boolean,
default: false
}
};
2 changes: 2 additions & 0 deletions typings/packages/slider.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ declare class XGanttSliderComponent extends XComponent {

flat: boolean;

highlightDate: boolean;

label: string;

linkedResize: boolean;
Expand Down

0 comments on commit 9ab0ebf

Please sign in to comment.