-
Notifications
You must be signed in to change notification settings - Fork 154
Update my.enableAlertBeforeUnload.md #2120
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
Conversation
1、修改弹窗示例图片。 2、修改错误码 8 解决方案。
@@ -47,7 +47,7 @@ Object 类型,参数如下: | |||
| **错误码** | **描述** | **解决方案** | | |||
| --- | --- | --- | | |||
| 7 | has not found page when enableAlertBeforeUnload has been invoked | 执行接口时小程序还未创建出任何一个页面实例,建议在 Page.onReady 回调内执行 my.enableAlertBeforeUnload。 | | |||
| 8 | can not invoke enableAlertBeforeUnload at first page | 若某个页面比较复杂(即可能是第一个页面,也可能不是第一个页面),可以通过 [getCurrentPages](https://opendocs.alipay.com/mini/framework/getcurrentpages) 获取页面栈并判断当前页面实例是不是处于第一个。 | | |||
| 8 | can not invoke enableAlertBeforeUnload at first page | 不支持在首页调用此弹窗,暂无解决方案。 | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"不支持在首页调用此弹窗,暂无解决方案" -- 1,是调 API ,不是调用弹窗;2,不是”暂无解决方案“,而是”不需要处理“。
@@ -47,7 +47,7 @@ Object 类型,参数如下: | |||
| **错误码** | **描述** | **解决方案** | | |||
| --- | --- | --- | | |||
| 7 | has not found page when enableAlertBeforeUnload has been invoked | 执行接口时小程序还未创建出任何一个页面实例,建议在 Page.onReady 回调内执行 my.enableAlertBeforeUnload。 | | |||
| 8 | can not invoke enableAlertBeforeUnload at first page | 若某个页面比较复杂(即可能是第一个页面,也可能不是第一个页面),可以通过 [getCurrentPages](https://opendocs.alipay.com/mini/framework/getcurrentpages) 获取页面栈并判断当前页面实例是不是处于第一个。 | | |||
| 8 | can not invoke enableAlertBeforeUnload at first page | 不支持在首页调用此弹窗,暂无解决方案。 | | |||
| 9 | client not support enableAlertBeforeUnload | 一般不会出现,此时表明当前客户端不支持调用此接口,暂无解决方案。 | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不是”暂无解决方案“,而是”不需要处理“。给人积极有效的建议。不要吓唬人
修改解决方案 8、 9 描述,需要去核实一下错误码 9 怎么复现,暂时先不和
错误码 8 添加不需要处理此报错
@@ -47,7 +47,7 @@ Object 类型,参数如下: | |||
| **错误码** | **描述** | **解决方案** | | |||
| --- | --- | --- | | |||
| 7 | has not found page when enableAlertBeforeUnload has been invoked | 执行接口时小程序还未创建出任何一个页面实例,建议在 Page.onReady 回调内执行 my.enableAlertBeforeUnload。 | | |||
| 8 | can not invoke enableAlertBeforeUnload at first page | 不支持在首页调用此接口,建议在非首页的页面去调用此接口。 | | |||
| 8 | can not invoke enableAlertBeforeUnload at first page | 不支持在首页调用此接口,不需要处理此报错,建议在非首页的页面去调用此接口。 | | |||
| 9 | client not support enableAlertBeforeUnload | 一般不会出现,出现则表明当前客户端不支持调用此接口,请使用支持的客户端版本调用此接口。 | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
具体的可支持的客户端版本号 建议也写一下
突然有个疑问:这个 API 是对当前页面生效,还是在应用级生效? |
@hbhftgf 这个 api 是只对当前页面生效的,当小程序离开当前页面时,会有弹窗弹出 |
| 7 | has not found page when enableAlertBeforeUnload has been invoked | 执行接口时小程序还未创建出任何一个页面实例,建议在 Page.onReady 回调内执行 my.enableAlertBeforeUnload。 | | ||
| 8 | can not invoke enableAlertBeforeUnload at first page | 若某个页面比较复杂(即可能是第一个页面,也可能不是第一个页面),可以通过 [getCurrentPages](https://opendocs.alipay.com/mini/framework/getcurrentpages) 获取页面栈并判断当前页面实例是不是处于第一个。 | | ||
| 9 | client not support enableAlertBeforeUnload | 一般不会出现,此时表明当前客户端不支持调用此接口,暂无解决方案。 | | ||
| 7 | has not found page when enableAlertBeforeUnload has been invoked | 调用接口时小程序还未创建出任何一个页面实例。请在 Page.onReady 以后调用。 | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“调用接口时小程序还未创建出任何一个页面实例” --- 这意思是只要之前已经创建过页面实例就可以成功吗?如果之前创建的是 A 和 B,现在是在 C 的页面 JS 文件里调用,什么是什么结果?从 C 回到 B 有弹框,还是从 B 回到 A 会有弹框?
1、修改示例图片。 2、修改错误码 7 的解决方案
1、修改弹窗示例图片。
2、修改错误码 8 解决方案。