Skip to content

Commit

Permalink
[zh-CN]: add translation for KeyboardLayoutMap.size (#23950)
Browse files Browse the repository at this point in the history
  • Loading branch information
skyclouds2001 authored Oct 9, 2024
1 parent 742a948 commit 35aca26
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions files/zh-cn/web/api/keyboardlayoutmap/size/index.md
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")}}

0 comments on commit 35aca26

Please sign in to comment.