-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[zh-CN]: add translation for
KeyboardLayoutMap.size
(#23950)
- Loading branch information
1 parent
742a948
commit 35aca26
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
title: KeyboardLayoutMap:size 属性 | ||
slug: Web/API/KeyboardLayoutMap/size | ||
l10n: | ||
sourceCommit: 33d8f835c12481741d0008c1ded4b91634e60d1c | ||
--- | ||
|
||
{{SeeCompatTable}}{{APIRef("Keyboard API")}} | ||
|
||
{{domxref("KeyboardLayoutMap")}} 接口的 **`size`** 只读属性返回映射中的元素数量。 | ||
|
||
该属性与 {{jsxref("Map.prototype.size")}} 相似。 | ||
|
||
## 值 | ||
|
||
一个数字。 | ||
|
||
## 示例 | ||
|
||
以下示例获取英文 QWERTY 键盘上位置或布局特定字符串及其关联键盘代码的数量。 | ||
|
||
```js | ||
navigator.keyboard.getLayoutMap().then((keyboardLayoutMap) => { | ||
console.log(keyboardLayoutMap.size); | ||
}); | ||
``` | ||
|
||
## 规范 | ||
|
||
{{Specifications}} | ||
|
||
## 浏览器兼容性 | ||
|
||
{{Compat}} | ||
|
||
## 参见 | ||
|
||
- {{jsxref("Map.prototype.size")}} |