提交 1cb6b5cc authored 作者: lihuihui's avatar lihuihui

update: 优化滚动

上级 4dbc80e3
...@@ -114,7 +114,8 @@ export default { ...@@ -114,7 +114,8 @@ export default {
// 当前题的下标 // 当前题的下标
questionIndex: 0, questionIndex: 0,
// 所有题 和题的信息 // 所有题 和题的信息
question: {} question: {},
domBScroll: null
} }
} }
}, },
...@@ -132,11 +133,11 @@ export default { ...@@ -132,11 +133,11 @@ export default {
}, },
methods: { methods: {
// 初始化bscroll插件 // 初始化bscroll插件
initBscroll(s = 200) { initBscroll() {
setTimeout(() => { setTimeout(() => {
const wrapper2 = this.$refs.wrapper2 const wrapper2 = this.$refs.wrapper2
new BScroll(wrapper2, { click: true, bounce: false, startY: 0, momentum: false }) this.domBScroll = new BScroll(wrapper2, { click: true })
}, s) }, 1000)
}, },
sendExamInfo(status) { sendExamInfo(status) {
const param = { const param = {
...@@ -300,7 +301,9 @@ export default { ...@@ -300,7 +301,9 @@ export default {
this.questionParams.questionIndex + 1 !== this.questionParams.question.total_question_count && this.questionParams.questionIndex + 1 !== this.questionParams.question.total_question_count &&
this.questionParams.questionIndex++ this.questionParams.questionIndex++
} }
this.initBscroll() this.domBScroll.refresh()
this.domBScroll.scrollTo(0, -10, 0)
// this.initBscroll()
}, },
getTopic() { getTopic() {
action.Exam.getTopic(this.$route.params.examId) action.Exam.getTopic(this.$route.params.examId)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论