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

添加componentWillPreload对应的hooks #8627

Closed
FE-Sakamoto opened this issue Feb 2, 2021 · 3 comments
Closed

添加componentWillPreload对应的hooks #8627

FE-Sakamoto opened this issue Feb 2, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@FE-Sakamoto
Copy link

这个特性解决了什么问题?

解决函数式组件无法使用componentWillPreload的功能

这个 API 长什么样?

usePreload(()=>{
return thenable
})

@taro-bot2 taro-bot2 bot added the enhancement New feature or request label Feb 2, 2021
@Chen-jj
Copy link
Contributor

Chen-jj commented Feb 3, 2021

哪个版本?

@FE-Sakamoto
Copy link
Author

哪个版本?

哪个版本都没有componentWillPreload对应的hooks吧

@ZakaryCode
Copy link
Contributor

Taro 3 不再提供 componentWillPreload、$preload API,改为:

调用:

Taro.preload()

获取

console.log(getCurrentInstance().preloadData)

参考文档

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

No branches or pull requests

3 participants