Skip to content

Commit f593f95

Browse files
author
zhe-he
committed
update address list
1 parent 7b7da69 commit f593f95

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/components/contact/contact.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<!--联系人集合-->
3131
<template v-for="(value,key) in contactsList">
3232
<!--首字母-->
33-
<div class="weui-cells__title">{{key}}</div>
33+
<div :ref="`key_${key}`" class="weui-cells__title">{{key}}</div>
3434
<div class="weui-cells">
3535
<router-link :key="item.wxid" :to="{path:'/contact/details',query:{wxid:item.wxid}}" class="weui-cell weui-cell_access" v-for="item in value"
3636
tag="div">
@@ -44,8 +44,8 @@
4444
</div>
4545
</template>
4646
</section>
47-
<!--首字母排序 后期需要实现检索功能-->
48-
<div class="initial-bar"><span v-for="i in contactsInitialList">{{i}}</span></div>
47+
<!--检索-->
48+
<div class="initial-bar"><span @click="toPs(i)" v-for="i in contactsInitialList">{{i}}</span></div>
4949
</div>
5050
</template>
5151
<script>
@@ -73,6 +73,11 @@
7373
},
7474
mounted() {
7575
76+
},
77+
methods: {
78+
toPs(i){
79+
window.scrollTo(0,this.$refs['key_'+i][0].offsetTop)
80+
}
7681
}
7782
}
7883
</script>

0 commit comments

Comments
 (0)