File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 30
30
<!-- 联系人集合-->
31
31
<template v-for =" (value ,key ) in contactsList " >
32
32
<!-- 首字母-->
33
- <div class =" weui-cells__title" >{{key}}</div >
33
+ <div :ref = " `key_${key}` " class =" weui-cells__title" >{{key}}</div >
34
34
<div class =" weui-cells" >
35
35
<router-link :key =" item.wxid" :to =" {path:'/contact/details',query:{wxid:item.wxid}}" class =" weui-cell weui-cell_access" v-for =" item in value"
36
36
tag =" div" >
44
44
</div >
45
45
</template >
46
46
</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 >
49
49
</div >
50
50
</template >
51
51
<script >
73
73
},
74
74
mounted () {
75
75
76
+ },
77
+ methods: {
78
+ toPs (i ){
79
+ window .scrollTo (0 ,this .$refs [' key_' + i][0 ].offsetTop )
80
+ }
76
81
}
77
82
}
78
83
</script >
You can’t perform that action at this time.
0 commit comments