修改切换路线是滚动条显示上一个位置
This commit is contained in:
@@ -225,7 +225,7 @@
|
|||||||
<div class="distance-info-left">
|
<div class="distance-info-left">
|
||||||
<div class="distance-info-left-item flexcenter" :class="{ 'pitch': index == academyPitchIndex }" v-for="(item, index) in annexSchoolList" :key="index" @click="selectAcademyIndex(index)">{{ item.alias }}</div>
|
<div class="distance-info-left-item flexcenter" :class="{ 'pitch': index == academyPitchIndex }" v-for="(item, index) in annexSchoolList" :key="index" @click="selectAcademyIndex(index)">{{ item.alias }}</div>
|
||||||
</div>
|
</div>
|
||||||
<el-scrollbar :style="{ height: 50 * annexSchoolList.length + 'px' }">
|
<el-scrollbar ref="elscrollbarRef" :style="{ height: 50 * annexSchoolList.length + 'px' }">
|
||||||
<div class="distance-info-right flex1">
|
<div class="distance-info-right flex1">
|
||||||
<div class="distance-header-box flexacenter">
|
<div class="distance-header-box flexacenter">
|
||||||
<div class="flexacenter">
|
<div class="flexacenter">
|
||||||
@@ -844,11 +844,13 @@ let annexSchoolList = ref([]) // 附近院校数据
|
|||||||
let academyPitchIndex = ref(0) // 附近学校距离选中院校 下标
|
let academyPitchIndex = ref(0) // 附近学校距离选中院校 下标
|
||||||
let targetAcademyPitch = ref({}) // 附近学校距离选中院校 数据
|
let targetAcademyPitch = ref({}) // 附近学校距离选中院校 数据
|
||||||
let specialSchoolDistance = ref(null) // 特殊的 用户带有school参数 则需要特殊显示 学校距离
|
let specialSchoolDistance = ref(null) // 特殊的 用户带有school参数 则需要特殊显示 学校距离
|
||||||
|
const elscrollbarRef = ref(null) // 滚动条
|
||||||
|
|
||||||
// 选择附近学校距离的学校下标
|
// 选择附近学校距离的学校下标
|
||||||
const selectAcademyIndex = index => {
|
const selectAcademyIndex = index => {
|
||||||
academyPitchIndex.value = index || 0
|
academyPitchIndex.value = index || 0
|
||||||
targetAcademyPitch.value = annexSchoolList.value[academyPitchIndex.value]
|
targetAcademyPitch.value = annexSchoolList.value[academyPitchIndex.value]
|
||||||
|
elscrollbarRef.value.setScrollTop(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 选择附近学校距离的学校下标
|
// 选择附近学校距离的学校下标
|
||||||
|
|||||||
@@ -363,7 +363,7 @@
|
|||||||
<div class="distance-info-left">
|
<div class="distance-info-left">
|
||||||
<div class="distance-info-left-item flexcenter" :class="{ 'pitch': index == academyPitchIndex }" v-for="(item, index) in annexSchoolList" :key="index" @click="selectAcademyIndex(index)">{{ item.alias }}</div>
|
<div class="distance-info-left-item flexcenter" :class="{ 'pitch': index == academyPitchIndex }" v-for="(item, index) in annexSchoolList" :key="index" @click="selectAcademyIndex(index)">{{ item.alias }}</div>
|
||||||
</div>
|
</div>
|
||||||
<el-scrollbar :style="{ height: 50 * annexSchoolList.length + 'px' }">
|
<el-scrollbar ref="elscrollbarRef" :style="{ height: 50 * annexSchoolList.length + 'px' }">
|
||||||
<div class="distance-info-right flex1">
|
<div class="distance-info-right flex1">
|
||||||
<div class="distance-header-box flexacenter">
|
<div class="distance-header-box flexacenter">
|
||||||
<div class="flexacenter">
|
<div class="flexacenter">
|
||||||
@@ -1309,13 +1309,17 @@ let annexSchoolList = ref([]) // 附近院校数据
|
|||||||
let academyPitchIndex = ref(0) // 附近学校距离选中院校 下标
|
let academyPitchIndex = ref(0) // 附近学校距离选中院校 下标
|
||||||
let targetAcademyPitch = ref({}) // 附近学校距离选中院校 数据
|
let targetAcademyPitch = ref({}) // 附近学校距离选中院校 数据
|
||||||
let specialSchoolDistance = ref(null) // 特殊的 用户带有school参数 则需要特殊显示 学校距离
|
let specialSchoolDistance = ref(null) // 特殊的 用户带有school参数 则需要特殊显示 学校距离
|
||||||
|
const elscrollbarRef = ref(null) // 滚动条
|
||||||
|
|
||||||
// 选择附近学校距离的学校下标
|
// 选择附近学校距离的学校下标
|
||||||
const selectAcademyIndex = index => {
|
const selectAcademyIndex = index => {
|
||||||
academyPitchIndex.value = index || 0
|
academyPitchIndex.value = index || 0
|
||||||
targetAcademyPitch.value = annexSchoolList.value[academyPitchIndex.value]
|
targetAcademyPitch.value = annexSchoolList.value[academyPitchIndex.value]
|
||||||
|
elscrollbarRef.value.setScrollTop(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 选择附近学校距离的学校下标
|
// 选择附近学校距离的学校下标
|
||||||
const selectIndex = id => {
|
const selectIndex = id => {
|
||||||
if (!id) id = pitchSchool
|
if (!id) id = pitchSchool
|
||||||
|
|||||||
Reference in New Issue
Block a user