Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[zh-CN]: add translation for KeyboardLayoutMap.size #23950

Merged
merged 2 commits into from
Oct 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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")}} 相同。
skyclouds2001 marked this conversation as resolved.
Show resolved Hide resolved

## 值

一个数字。

## 示例

以下示例获取英文 QWERTY 键盘上位置或布局特定字符串及其关联键盘代码的数量。

```js
navigator.keyboard.getLayoutMap().then((keyboardLayoutMap) => {
console.log(keyboardLayoutMap.size);
});
```

## 规范

{{Specifications}}

## 浏览器兼容性

{{Compat}}

## 参见

- {{jsxref("Map.prototype.size")}}