Skip to content

Commit

Permalink
style: 🌈 update code
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyjone committed Jun 5, 2023
1 parent 41ccbd3 commit cc6c800
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/container/GanttBody.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
>
<!-- 滑动条 -->
<template v-for="d in inView" :key="d.uuid">
<RowVue :data="d" class="xg-gantt-row" :render-style="false">
<RowVue :data="d" class="xg-gantt-row" :render-style="false" long-press>
<component :is="$slotsBox.slider" :data="d" />
</RowVue>
</template>
Expand Down
10 changes: 9 additions & 1 deletion src/components/container/Row.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,15 @@ import { Ref, computed, ref } from 'vue';
const props = defineProps({
data: RowItem,
renderStyle: { type: Boolean, default: true }
renderStyle: { type: Boolean, default: true },
longPress: { type: Boolean, default: false }
});
const { rowHeight, $styleBox } = useStyle();
const { $param } = useParam();
// #region set hover
function onEnter() {
$param.hoverItem = props.data ?? null;
}
Expand All @@ -56,7 +59,9 @@ function onLeave() {
$param.hoverItem = null;
}
// #endregion
// #region background color
const bgColor = computed(() => {
if (!props.renderStyle) return undefined;
Expand All @@ -73,7 +78,9 @@ const bgColor = computed(() => {
return c;
});
// #endregion
// #region 点击事件
const { jumpToDate } = useExport();
const { EmitRowClick, EmitRowDblClick } = useEvent();
const rowRef = ref(null) as Ref<HTMLDivElement | null>;
Expand All @@ -90,6 +97,7 @@ onUnifyClick(rowRef, {
EmitRowDblClick(props.data?.data);
}
});
// #endregion
</script>

<style lang="scss">
Expand Down

0 comments on commit cc6c800

Please sign in to comment.