如何使用扩展名中的Visual Studio代码中创建一个新的面板部分

发布于 2025-01-18 21:49:58 字数 355 浏览 2 评论 0原文

如何创建像 Gitlens 那样的面板部分(请参见下面的屏幕截图)?我查看了 此处 提供的文档和 Github 示例,但找不到关于如何创建这个的任何内容。

我想在终端旁边有一个按钮,当我按下它时可以显示一个网络视图。

输入图片此处描述

How can I create a panel section like the one that Gitlens has (see the screenshot below)? I've looked over the documentation and the Github examples presented here and I could not find anything on how to create this.

I want to have a button there next to TERMINAL and when I press on it to present a webview.

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

停滞 2025-01-25 21:49:58

我已经通过在贡献对象中创建一个ViewContainer来做到这一点。

"viewsContainers": {
            "panel": [
                {
                    "id": "myPanel",
                    "title": "Colors",
                    "icon": "images/views/history.svg"
                }
            ]
        },

然后,我创建了使用ViewContainer的视图。

    "contributes": {
        "views": {
            "myPanel": [
                {
                    "type": "webview",
                    "id": "calicoColors.colorsView",
                    "name": "Calico Colors"
                }
            ]
        },

I have managed to do this by creating a viewContainer in the contributes object.

"viewsContainers": {
            "panel": [
                {
                    "id": "myPanel",
                    "title": "Colors",
                    "icon": "images/views/history.svg"
                }
            ]
        },

and then I create a view that uses the viewContainer.

    "contributes": {
        "views": {
            "myPanel": [
                {
                    "type": "webview",
                    "id": "calicoColors.colorsView",
                    "name": "Calico Colors"
                }
            ]
        },
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文