筛选组件学校显示优化
This commit is contained in:
@@ -51,7 +51,7 @@
|
||||
class="img" alt="">
|
||||
</div>
|
||||
<el-carousel :autoplay="false" arrow="never" :loop="false" height="50px"
|
||||
indicator-position="none" class="s-w-100" ref="schoolData">
|
||||
indicator-position="none" class="s-w-100" ref="schoolData" :initial-index="schoolSelectObj.page">
|
||||
<el-carousel-item v-for="(item, i) in shcoolData" :key="i">
|
||||
<div class="school-carousel-box" :class="{ 'jus-sp': item.length === 4 }">
|
||||
<div v-for="(items, i) in item" :key="items" @click="setSchoolObj(items)"
|
||||
@@ -328,7 +328,7 @@ let selectPosition = ref('region')
|
||||
let showSelect = ref(false)
|
||||
|
||||
//学校区域状态
|
||||
let schoolSelectObj = reactive({ id: '', title: '不限' })
|
||||
let schoolSelectObj = reactive({ id: '', title: '不限',page:'' })
|
||||
let schoolPages = ref(0) //页数
|
||||
let shcoolData = shallowReactive([])
|
||||
let setSchoolData = () => {
|
||||
@@ -340,11 +340,12 @@ let setSchoolData = () => {
|
||||
shcoolData[num] = []
|
||||
}
|
||||
if (shcoolData[num].length < 4) shcoolData[num].push(arr[i])
|
||||
|
||||
if(arr[i].id===schoolSelectObj.id)schoolSelectObj['page']=num
|
||||
if (shcoolData[num].length === 4) {
|
||||
num++
|
||||
}
|
||||
}
|
||||
console.log(schoolSelectObj)
|
||||
}
|
||||
|
||||
//选择学校区域属性
|
||||
|
||||
Reference in New Issue
Block a user