Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
unidocs-uni-app-x-zh
提交
0260f284
U
unidocs-uni-app-x-zh
项目概览
DCloud
/
unidocs-uni-app-x-zh
通知
164
Star
2
Fork
38
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
14
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
unidocs-uni-app-x-zh
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
14
合并请求
14
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
0260f284
编写于
11月 04, 2024
作者:
DCloud-WZF
💬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
docs(UniPage): 优化 this.$page 获取页面实例说明
上级
1d60ceea
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
0 deletion
+14
-0
docs/api/dialog-page.md
docs/api/dialog-page.md
+4
-0
docs/api/get-current-pages.md
docs/api/get-current-pages.md
+10
-0
未找到文件。
docs/api/dialog-page.md
浏览文件 @
0260f284
...
...
@@ -87,6 +87,10 @@ const page = pages[pages.length-1]
const
dialogPages
=
page
.
getDialogPages
()
// 2. 在 dialogPage 中通过 this.$page 获取 dialogPage 实例
// 选项式 API
const
dialogPage
=
this
.
$page
// 组合式 API
const
currentInstance
=
getCurrentInstance
()
const
dialogPage
=
instance
?.
proxy
?.
$page
```
*
`UniDialogPage`
实例的
`getElementById`
方法仅
`Android`
端支持,其他端返回
`null`
。
docs/api/get-current-pages.md
浏览文件 @
0260f284
...
...
@@ -51,3 +51,13 @@ UniPage对象强化了开发者对页面的管理功能,并且支持在uts插
<!-- UTSAPIJSON.general_type.name -->
<!-- UTSAPIJSON.general_type.param -->
## Tips
*
`4.32`
新增支持通过
`this.$page`
获取当前
`UniPage`
实例, 代码示例:
```
js
// 选项式 API
const
dialogPage
=
this
.
$page
// 组合式 API
const
currentInstance
=
getCurrentInstance
()
const
dialogPage
=
instance
?.
proxy
?.
$page
```
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录