按钮在vaadin-Grid内部工作(JavaScript)

发布于 2025-02-11 20:09:18 字数 416 浏览 3 评论 0原文

我想在新标签中打开一个链接,但在网格中不起作用,我想打开一个链接。我在网格外测试了代码,然后在那里工作。一切都用点亮完成。

这是代码的一部分:

<vaadin-grid-column resizable="" path="action" header="Action">
  <template>
    <button @click="${this._openTab()}"Test</button>
  </template>
</vaadin-grid-column>

_opentab函数:

_openTab(e){
  window.open("https://google.com", "_blank");
}

I have a button in a vaadin grid that I want to open a link in a new tab, but it doesn't work inside the grid. I tested the code outside the grid, and it worked there. Everything is done using Lit.

Here's part of the code:

<vaadin-grid-column resizable="" path="action" header="Action">
  <template>
    <button @click="${this._openTab()}"Test</button>
  </template>
</vaadin-grid-column>

The _openTab function:

_openTab(e){
  window.open("https://google.com", "_blank");
}

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文