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

使用drag组件,在listData添加数据后重新调用drag.init()方法后图片不显示 #42

Open
z-jt-best opened this issue Mar 3, 2021 · 0 comments

Comments

@z-jt-best
Copy link

listData添加数据后再调用drag.init()方法后有几率会出现新添加的数据不显示的问题
代码如下:
const newBannerList = this.data.listData

    console.log('result')
    console.log(result)

    newBannerList.push({
        images: result[0],
        fixed: false
    })

    // 延迟一点进行组件初始化(官方组件示例是这么使用的)
    setTimeout(() => {
        this.setData({
            listData: newBannerList
        })
        this.drag.init();
    }, 300)
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

1 participant