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

是否支持原生小程序? #34

Open
wxf-start opened this issue Oct 25, 2023 · 12 comments
Open

是否支持原生小程序? #34

wxf-start opened this issue Oct 25, 2023 · 12 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@wxf-start
Copy link

No description provided.

@1977474741
Copy link
Owner

原生小程序一直都支持的

@GOGOGOSIR
Copy link

原生小程序下的组件还不支持自定义钩子,比如 onReadyUserInfo 没有触发

@GOGOGOSIR
Copy link

这个写法挺好的,希望作者兼容下原生小程序的组件,因为确实有写场景需要在组件内部依赖用户信息的

@GOGOGOSIR
Copy link

image
我在这里看到有声明但是不知道为啥不触发

@1977474741
Copy link
Owner

图像 我看到有声明但不知道是啥不在这里触发

这里的ready和attached是vue的钩子。原生小程序Component内部this上没有生命周期函数,我得研究下如何实现。

@GOGOGOSIR
Copy link

原生小程序的component的this确实没有挂载 生命周期函数,也就是说这两种方式都无法再原生的component里触发是吗?
image

@1977474741
Copy link
Owner

原生小程序的component的this确实没有挂载 生命周期函数,也就是说这两种方式都无法再原生的component里触发是吗? image
是的,因为现在本身逻辑都是不支持的。昨天我试了下可以实现,预计下周能发布一个新版本支持所有小程序的组件。

@FullOfVigour
Copy link

原生小程序的component的this确实没有挂载 生命周期函数,也就是说这两种方式都无法再原生的component里触发是吗? image
是的,因为现在本身逻辑都是不支持的。昨天我试了下可以实现,预计下周能发布一个新版本支持所有小程序的组件。

您好,现在版本支持小程序组件了吗?支持的化能更新下小程序demom ,给里面加一个小程序的写法

@1977474741
Copy link
Owner

1977474741 commented Dec 1, 2023

原生小程序的component的this确实没有挂载 生命周期函数,也就是说这两种方式都无法再原生的component里触发是吗? image
是的,因为现在本身逻辑都是不支持的。昨天我试了下可以实现,预计下周能发布一个新版本支持所有小程序的组件。

您好,现在版本支持小程序组件了吗?支持的化能更新下小程序demom ,给里面加一个小程序的写法

刚发布了新版本,支持所有原生小程序的组件,包括lifetimes和pageLifetimes,用法跟原生钩子的用法一样

@freestyle-coding
Copy link

freestyle-coding commented Jan 12, 2024

原生小程序的component的this确实没有挂载 生命周期函数,也就是说这两种方式都无法再原生的component里触发是吗? image
是的,因为现在本身逻辑都是不支持的。昨天我试了下可以实现,预计下周能发布一个新版本支持所有小程序的组件。

您好,现在版本支持小程序组件了吗?支持的化能更新下小程序demom ,给里面加一个小程序的写法

刚发布了新版本,支持所有原生小程序的组件,包括lifetimes和pageLifetimes,用法跟原生钩子的用法一样

有bug, 微信小程序的组件不支持, 例如onAttachedLogin 这样的, 原因是hookInit方法在还未调用过的情况下就出现了customHooks已经存在的情况,导致初始化过程中没有自定义的钩子

@1977474741 1977474741 added bug Something isn't working enhancement New feature or request and removed bug Something isn't working enhancement New feature or request labels Jan 12, 2024
@1977474741 1977474741 self-assigned this Jan 12, 2024
@freestyle-coding
Copy link

另外,微信小程序组件的生命周期钩子不是以on开头的,但自定义钩子需要以on开头,例如attached和Login结合使用需要写成onAttachedLogin 而不是attachedLogin, 建议更新一下文档说明一下

@1977474741
Copy link
Owner

另外,微信小程序组件的生命周期钩子不是以on开头的,但自定义钩子需要以on开头,例如attached和Login结合使用需要写成onAttachedLogin 而不是attachedLogin, 建议更新一下文档说明一下

这个问题修复了,另外文档也加了说明,感谢提出建议v1.4.2

@1977474741 1977474741 pinned this issue Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants