angular - ng5-slider 捕捉焦点事件
问题描述
我正在使用 Angular 8 和 ng5-slider。我想知道是否有任何方法可以捕捉滑块焦点事件。
我需要创建的内容:
在关注 minValue/maxValue 点(在滑块上)时,我想显示一个日期选择器。
app.component.ts
import { Component, EventEmitter } from '@angular/core';
import { Options, PointerType } from 'ng5-slider';
@Component({
selector: 'app-trigger-focus-slider',
templateUrl: './trigger-focus-slider.component.html'
})
export class TriggerFocusSliderComponent {
triggerFocus: EventEmitter<PointerType> = new EventEmitter<PointerType>();
minValue: number = 20;
maxValue: number = 80;
options: Options = {
floor: 0,
ceil: 100,
step: 5
};
PointerType: any = PointerType;
focusSlider(pointerType: PointerType): void {
this.triggerFocus.emit(pointerType);
}
}
app.component.html
<p>
<button type="button" class="btn btn-outline-primary" (click)="focusSlider(PointerType.Min)">Focus min pointer</button>
<button type="button" class="btn btn-outline-primary" (click)="focusSlider(PointerType.Max)">Focus max pointer</button>
</p>
<ng5-slider [(value)]="minValue" [(highValue)]="maxValue" [options]="options" [triggerFocus]="triggerFocus"></ng5-slider>
免责声明
我是 Angular 的新手
解决方案
推荐阅读
- excel - Excel:使用具有多个结果的多个条件进行搜索
- c++ - 在C++中,当模板参数没有出现在下面的类或函数声明中时,它有什么用?
- oracle - 我们可以在 oracle 中找到外部表的 ddl 脚本(任何系统表)
- c - 在 C 输入重定向问题中实现 shell
- java - 在当前主题中找不到“@attr/textappearancebutton”
- linux - 通过递增值和乘法进行文本操作
- java - 为什么我的素数测试在 1 之后停止并且似乎无法继续?
- asp-classic - Zoom Meeting API - msxml6.dll 错误“80070005”访问被拒绝
- amazon-web-services - 多可用区环境下的实例自动伸缩
- python - Python Selenium 循环通过 MySQL 中的组