【文档优化】WindowLimits文档中明确标注参数为可选参数,但是仅传入部分参数后调用window.setWindowLimits报错
【问题描述】:根据WindowLimits描述,四个属性均为可选参数,但调用window.setWindowLimits接口时传入部分属性后报错401,传入全部四个属性后能够正常调用。是否是官方文档中的描述有问题,还是针对该接口有特殊要求?希望能够完善文档中的描述
【问题现象】:windowLimits传入部分参数后调用window.setWindowLimits报错401
【版本信息】:系统版本:6.0.0;API版本:6.0.0(20);开发工具版本:6.0.1.260
【复现代码】:
try {
let windowLimits: window.WindowLimits = {
minWidth: 100,
minHeight: 100
};
let promise = windowClass.setWindowLimits(windowLimits, true);
promise.then((data) => {
console.info(`Succeeded in changing the window limits. Cause: ${JSON.stringify(data)}`);
}).catch((err: BusinessError) => {
console.error(`Failed to change the window limits. Cause code: ${err.code}, message: ${err.message}`);
});
} catch (exception) {
console.error(`Failed to change the window limits. Cause code: ${exception.code}, message: ${exception.message}`);
}【尝试解决方案】:参考setWindowLimits示例代码windowLimits设置为下面代码所示后问题解决,但是参数文档中明确表达参数均为可选参数
let windowLimits: window.WindowLimits = {
maxWidth: 1500,
maxHeight: 1000,
minWidth: 100,
minHeight: 100
} 3
浏览140 编辑于2025-12-30 09:27湖北
全部评论
最多点赞
最新发布
最早发布
写回答
所见即所得编辑器, editor1
工具栏
0/50000
新增插入模板功能
一键使用模板,快速填写内容,轻松发帖~
知道了
- 为了保障您的信息安全,请勿上传您的敏感个人信息(如您的密码等信息)和您的敏感资产信息(如关键源代码、签名私钥、调试安装包、业务日志等信息),且您需自行承担由此产生的信息泄露等安全风险。
- 如您发布的内容为转载内容,请注明内容来源。
我要提问题
了解社区公约,与您携手共创和谐专业的开发者社区。








































苏公安网备 32011402010933号