Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
1d7a2075
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
6045
Star
91
Fork
165
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
19
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
19
Issue
19
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
1d7a2075
编写于
11月 25, 2024
作者:
H
hdx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
create-selector-query: 适配微信
上级
59a33514
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
30 addition
and
10 deletion
+30
-10
pages/API/create-selector-query/create-selector-query.uvue
pages/API/create-selector-query/create-selector-query.uvue
+15
-7
pages/API/create-selector-query/selector-query-child-multi.uvue
...API/create-selector-query/selector-query-child-multi.uvue
+15
-3
未找到文件。
pages/API/create-selector-query/create-selector-query.uvue
浏览文件 @
1d7a2075
...
@@ -90,13 +90,15 @@
...
@@ -90,13 +90,15 @@
fieldsResultContainNode: false,
fieldsResultContainNode: false,
nodeResultContainNode: false
nodeResultContainNode: false
}
}
},
onLoad() {
uni.$on('childReady', this.onChildReady)
},
onUnload() {
uni.$off('childReady', this.onChildReady)
},
},
onReady() {
onReady() {
const instance2 = (this.$refs['multi-child'] as ComponentPublicInstance)
this.testFields()
this.selectCount = instance2.$data['selectCount'] as number
this.selectAllCount = instance2.$data['selectAllCount'] as number
this.testFields()
this.testNode()
this.testNode()
},
},
onResize() {
onResize() {
...
@@ -109,7 +111,13 @@
...
@@ -109,7 +111,13 @@
}
}
} */
} */
},
},
methods: {
methods: {
// 仅用于自动化测试
onChildReady() {
const instance2 = (this.$refs['multi-child'] as ComponentPublicInstance);
this.selectCount = instance2.$data['selectCount'] as number;
this.selectAllCount = instance2.$data['selectAllCount'] as number;
},
// 仅用于自动化测试
// 仅用于自动化测试
getRootNodeInfo(selector : string) {
getRootNodeInfo(selector : string) {
uni.createSelectorQuery().select(selector).boundingClientRect().exec((ret) => {
uni.createSelectorQuery().select(selector).boundingClientRect().exec((ret) => {
...
...
pages/API/create-selector-query/selector-query-child-multi.uvue
浏览文件 @
1d7a2075
...
@@ -21,7 +21,8 @@
...
@@ -21,7 +21,8 @@
viewCount: 0,
viewCount: 0,
selectCount: 0,
selectCount: 0,
selectAllCount: 0,
selectAllCount: 0,
show: false
show: false,
testCounter: 0
}
}
},
},
mounted() {
mounted() {
...
@@ -29,14 +30,25 @@
...
@@ -29,14 +30,25 @@
this.text1 = JSON.stringify(ret, null, 2)
this.text1 = JSON.stringify(ret, null, 2)
if (ret.length == 1) {
if (ret.length == 1) {
this.selectCount = ret.length
this.selectCount = ret.length
}
}
this.testCounter++
this._dispatchEvent()
})
})
uni.createSelectorQuery().in(this).selectAll('.selector-query-view').boundingClientRect().exec((ret) => {
uni.createSelectorQuery().in(this).selectAll('.selector-query-view').boundingClientRect().exec((ret) => {
this.text2 = JSON.stringify(ret, null, 2)
this.text2 = JSON.stringify(ret, null, 2)
if (ret.length == 1) {
if (ret.length == 1) {
this.selectAllCount = (ret[0] as NodeInfo[]).length
this.selectAllCount = (ret[0] as NodeInfo[]).length
}
}
this.testCounter++
this._dispatchEvent()
})
})
},
methods: {
_dispatchEvent() {
if (this.testCounter == 2) {
uni.$emit('childReady')
}
}
}
}
}
}
</script>
</script>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录