console:groupCollapsed() 静态方法
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
console.groupCollapsed()
方法在 Web 控制台上创建一个新的分组。与 console.group()
方法的不同点是,新建的分组默认是折叠的。用户必须点击一个按钮才能将折叠的内容打开。
调用 console.groupEnd()
以回到父级分组。
参见 console
文档中的在控制台中使用分组以获取详情和示例。
备注: 此特性在 Web Worker 中可用。
语法
js
groupCollapsed()
groupCollapsed(label)
参数
label
-
分组的标签,为可选值。
返回值
无(undefined
)。
规范
Specification |
---|
Console # groupcollapsed |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
groupCollapsed() static method |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- See implementation notes.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.