子组件中<div class="area" ref="area_scroll" v-if="cityInfo">

 

import BScroll from "better-scroll";

 

methods: {
initScroll() {
this.scroll = new BScroll(this.$refs.area_scroll, {
click: true
});
},

 

父组件列表调用

 <Alphabet :cityInfo="cityInfo" :keys="keys" ref="allcity"/>

this.$nextTick(() => {
this.$refs.allcity.initScroll();
});

posted on 2020-09-16 16:03  心意如水hucuie22  阅读(580)  评论(0编辑  收藏  举报