Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

初始化报错:This is an invalid selector #31

Open
hetingyi opened this issue Sep 5, 2018 · 2 comments
Open

初始化报错:This is an invalid selector #31

hetingyi opened this issue Sep 5, 2018 · 2 comments

Comments

@hetingyi
Copy link

hetingyi commented Sep 5, 2018

场景 => 在一个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()
]
})

@HcySunYang
Copy link
Owner

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

@hetingyi
Copy link
Author

hetingyi commented Sep 5, 2018

解决了初始化问题,但是滚动高度计算不对,必须要在 mounted 里面
let fm_menu = new Fmover 以后

setTimeout(() => { fm_menu[0].refresh(function () { console.log('回调完成') }) }, 2000)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants