【问题标题】:On double click on accordion, open modal in angular 4双击手风琴,在角度 4 中打开模态
【发布时间】:2018-06-25 02:33:09
【问题描述】:

我正在使用手风琴,双击手风琴时我想打开模态。由于单击它会扩展内容,我想双击它并打开模式。是否可以双击手风琴

<ngb-accordion>
    <ngb-panel id="toggle-2" title="Second">
            <ng-template ngbPanelContent>
                  Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia
                  aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor,
                  sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica,
                  craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings
                  occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus
                  labore sustainable VHS.
                </ng-template>
              </ngb-panel>
 </ngb-accordion>

如果我双击标题,模态应该打开。

【问题讨论】:

  • 你可以使用(dblclick)事件。示例plunker
  • 我知道有一个 (dblclick) 存在。我问手风琴有可能
  • 您使用的是哪种手风琴
  • ng-bootstrap 手风琴
  • 你能添加你正在尝试的代码吗,如果可能的话请有一个工作示例

标签: angular typescript angular-cli angular5


【解决方案1】:

是的,在纯 javascript 中有 dblclick() 事件。

在角度,你可以像(dblclick)="myFunction()"一样使用

更多活动请关注here

【讨论】:

  • 如果你用手风琴双击显示一些代码会很高兴
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-08-13
  • 1970-01-01
  • 1970-01-01
  • 2023-03-15
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多