使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
blockly > 事件 > 已选择 > (constructor)
Events.Selected.(constructor)
构造 Selected
类的新实例
Signature:
constructor(opt_oldElementId?: string | null, opt_newElementId?: string | null, opt_workspaceId?: string);
参数
参数 |
类型 |
说明 |
opt_oldElementId |
字符串 | null |
(可选)之前所选元素的 ID。如果上次未选择任何元素,则为 null。对于空白事件,此值为未定义。 |
opt_newElementId |
字符串 |null |
(可选)所选元素的 ID。如果当前未选中任何元素,则为 null(取消选择)。对于空白事件,此值为未定义。 |
opt_workspaceId |
字符串 |
(可选)此事件的工作区标识符。如果之前未选择任何元素,则为 null。对于空白事件,则未定义。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-25。"],[],["The `Selected` class constructor creates a new instance, capturing element selection changes. It accepts optional parameters: `opt_oldElementId` (ID of the previously selected element, can be null), `opt_newElementId` (ID of the currently selected element, can be null), and `opt_workspaceId` (the workspace's identifier). Null values indicate no element was previously or is currently selected, while undefined indicates a blank event. These parameters detail the selection change and its context within a specific workspace.\n"]]