小程序能否实现一个项目里不同的页面中悬浮相同的弹窗,弹窗内数据可共享?

小程序 文章 2021-12-23 20:40 335 0 全屏看文

AI助手支持GPT4.0

小程序能否实现一个项目里不同的页面中悬浮相同的弹窗,弹窗内数据可共享?Can the applet realize the same pop-up window floating on different pages in a project, and the data in the pop-up window can be shared?

小程序能否实现一个项目里不同的页面中悬浮相同的弹窗,弹窗内数据可共享?

类似于native里面悬浮弹窗吊起的效果,一直存在在页面的顶层,不影响弹窗底层的页面操作

Similar to the suspended pop-up window hanging effect in native, it always exists at the top of the page and does not affect the page operation at the bottom of the pop-up window

回答:

老张:

存globalData里,每页的onShow里渲染出来。

Sun:mobx是数据共享,但是组件或者插件不太行,想实现一个插件,用户调用插件后,在业务代码的所有页面里面都可以显示出来的效果
拾忆:

不可以,除非你做成单页,其它页面都是模板或者组件形式在单页中加载切换。

Sun:好的   感谢~

-EOF-

AI助手支持GPT4.0