finger-mover icon indicating copy to clipboard operation
finger-mover copied to clipboard

初始化报错:This is an invalid selector

Open hetingyi opened this issue 6 years ago • 2 comments

场景 => 在一个vue单组件goods里面调用,goods跟父组件是路由关系,有v-if判断,如果vuex里面的异步接收完以后,才会显示

// Import finger-mover import Fmover from 'finger-mover' // Import vertical scroll simulation plugin simulation-scroll-y import simulationScrollY from 'simulation-scroll-y'

let fm_menu = new Fmover({ el: '#menu-box', plugins: [ simulationScrollY() ] })

hetingyi avatar Sep 05 '18 15:09 hetingyi

要保证在 mounted 钩子中实例化 new Fmover()

HcySunYang avatar Sep 05 '18 15:09 HcySunYang

解决了初始化问题,但是滚动高度计算不对,必须要在 mounted 里面 let fm_menu = new Fmover 以后 再 setTimeout(() => { fm_menu[0].refresh(function () { console.log('回调完成') }) }, 2000)

hetingyi avatar Sep 05 '18 16:09 hetingyi