- 发布:2021-10-29 12:56
- 更新:2021-10-29 12:56
- 阅读:301
产品分类: uniapp/App
PC开发环境操作系统: Mac
PC开发环境操作系统版本号: mac11.4
HBuilderX类型: 正式
HBuilderX版本号: 3.2.9
手机系统: 全部
页面类型: vue
打包方式: 云端
项目创建方式: HBuilderX
测试过的手机:
示例代码:
var K = {
dataset: true,
size: true,
rect: true,
computedStyle: ["fontFamily", "fontSize", "fontStyle", "fontWeight"],
node: true,
properties: ["checked", "color", "disabled", "icon", "mode", "placeholder", "placeholderStyle",
"placeholderClass", "plain", "src", "style", "type", "value"
]
};
uni.createSelectorQuery().selectAll("#id")
.fields(K, data => {
console.log("得到节点信息" + JSON.stringify(data));
console.log("节点的宽为" + data.width);
}).exec();
var K = {
dataset: true,
size: true,
rect: true,
computedStyle: ["fontFamily", "fontSize", "fontStyle", "fontWeight"],
node: true,
properties: ["checked", "color", "disabled", "icon", "mode", "placeholder", "placeholderStyle",
"placeholderClass", "plain", "src", "style", "type", "value"
]
};
uni.createSelectorQuery().selectAll("#id")
.fields(K, data => {
console.log("得到节点信息" + JSON.stringify(data));
console.log("节点的宽为" + data.width);
}).exec();
操作步骤:
直接运行就可以 APP和小程序返回结果不一致
直接运行就可以 APP和小程序返回结果不一致
预期结果:
bottom: 124.78125
dataset: {type: "input"}
disabled: true
fontFamily: "UICTFontTextStyleBody"
fontSize: "14px"
fontStyle: "normal"
fontWeight: "400"
height: 22.390625
left: 0
nodeCanvasType: "text"
placeholder: ""
placeholderClass: ""
placeholderStyle: ""
right: 375
top: 102.390625
type: "text"
value: "12345"
width: 375
bottom: 124.78125
dataset: {type: "input"}
disabled: true
fontFamily: "UICTFontTextStyleBody"
fontSize: "14px"
fontStyle: "normal"
fontWeight: "400"
height: 22.390625
left: 0
nodeCanvasType: "text"
placeholder: ""
placeholderClass: ""
placeholderStyle: ""
right: 375
top: 102.390625
type: "text"
value: "12345"
width: 375
实际结果:
{
"bottom": 177.5625,
"height": 22.390625,
"fontSize": "16px",
"fontWeight": "normal",
"width": 428,
"fontFamily": "\"PingFang SC\", Arial, \"Hiragino Sans GB\", \"Microsoft YaHei\", sans-serif",
"left": 0,
"dataset": {
"type": "input"
},
"right": 428,
"top": 155.171875,
"fontStyle": "normal"
}
{
"bottom": 177.5625,
"height": 22.390625,
"fontSize": "16px",
"fontWeight": "normal",
"width": 428,
"fontFamily": "\"PingFang SC\", Arial, \"Hiragino Sans GB\", \"Microsoft YaHei\", sans-serif",
"left": 0,
"dataset": {
"type": "input"
},
"right": 428,
"top": 155.171875,
"fontStyle": "normal"
}
bug描述:
方法内的可选参数 properties 在app内无任何返回结果,但是小程序内是正常的
0 个回复