Commit 9bf886b7 authored by Jenny's avatar Jenny

feat: 选项卡吸顶配置

parent e93ac0e3
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
class="view-element" class="view-element"
v-if="!element.hide" v-if="!element.hide"
:key="element.id" :key="element.id"
:class="[element.type == 'NormalTabs' && element.option.tabs.sticky && pageScrollTop > Number(element.top) ? 'el-fixed': '']"
:style="{ :style="{
width: `${parseInt(element.width * scale)}px`, width: `${parseInt(element.width * scale)}px`,
height: `${parseInt(element.height * scale)}px`, height: `${parseInt(element.height * scale)}px`,
...@@ -60,7 +61,8 @@ ...@@ -60,7 +61,8 @@
data() { data() {
return { return {
reportInfo: {}, reportInfo: {},
timename: null timename: null,
pageScrollTop: 0
} }
}, },
computed: { computed: {
...@@ -226,7 +228,10 @@ ...@@ -226,7 +228,10 @@
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.getReportCharts() this.getReportCharts()
} },
onPageScroll(res) {
this.pageScrollTop = res.scrollTop
},
} }
</script> </script>
...@@ -245,4 +250,8 @@ ...@@ -245,4 +250,8 @@
user-select: none; user-select: none;
cursor: move; cursor: move;
} }
.el-fixed {
position: sticky;
top: 0 !important;
}
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment