提交 54de5a55 编写于 作者: guangjun.yang's avatar guangjun.yang

定位问题

上级 14dc5073
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
</ul> </ul>
</div> </div>
</article> </article>
<article ref="zjListRef" class="page-content-list"> <article ref="zjListRef" id="zjListRef" class="page-content-list">
<CommonImgTitle imgType=2 title="中级职称"></CommonImgTitle> <CommonImgTitle imgType=2 title="中级职称"></CommonImgTitle>
<div :id="'subject_1_' + index" class="subject" v-for="(item, index) in zjFirstSubjectModelList" :key="index"> <div :id="'subject_1_' + index" class="subject" v-for="(item, index) in zjFirstSubjectModelList" :key="index">
<p>{{item.name}}<span v-show="item.titleCode">{{item.titleCode}}</span></p> <p>{{item.name}}<span v-show="item.titleCode">{{item.titleCode}}</span></p>
...@@ -160,11 +160,7 @@ export default { ...@@ -160,11 +160,7 @@ export default {
}, },
mounted() { mounted() {
zjListOffsetTop = this.$refs['zjListRef'].offsetTop;
screenHeight = screen.height;
console.log('zjListOffsetTop, screenHeight', zjListOffsetTop, screenHeight);
// zjListRef
// this.listData = [];
}, },
methods: { methods: {
...@@ -262,6 +258,16 @@ export default { ...@@ -262,6 +258,16 @@ export default {
titleTestModelList.splice(1, 1); titleTestModelList.splice(1, 1);
this.resetPosition(titleTestModelList); this.resetPosition(titleTestModelList);
} }
this.$forceUpdate();
// 延迟获取中级职称
this.$nextTick(() => {
setTimeout(() => {
zjListOffsetTop = document.getElementById('zjListRef').offsetTop;
screenHeight = screen.height;
console.log('zjListOffsetTop, screenHeight', zjListOffsetTop, screenHeight);
}, 100);
});
} else { } else {
this.$toast(res.message); this.$toast(res.message);
} }
...@@ -336,6 +342,8 @@ export default { ...@@ -336,6 +342,8 @@ export default {
// 监听滚动事件 // 监听滚动事件
scrollFun() { scrollFun() {
let scrollTop = window.scrollY; let scrollTop = window.scrollY;
// console.log(scrollTop, screenHeight, zjListOffsetTop);
if(scrollTop + screenHeight - 20 > zjListOffsetTop) { if(scrollTop + screenHeight - 20 > zjListOffsetTop) {
this.tabIndex = 2; this.tabIndex = 2;
} else { } else {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册