如何以编程方式告诉HTML select下拉(例如,由于鼠标悬停)?
我在一个页面上有几个 ng-select,我试图从 ts 打开一个。
我可以使用以下方法专注于正确的 ng-select:
@ViewChildren(NgSelectComponent) ngselect: QueryList<NgSelectComponent>;
this.ngselect.last.filterInput.nativeElement.focus()
Run Code Online (Sandbox Code Playgroud)
但是,我无法打开。我尝试了以下
this.ngselect.last.filterInput.nativeElement.open()
Run Code Online (Sandbox Code Playgroud)
但得到错误:
_this.ngselect.last.filterInput.nativeElement.open is not a function
Run Code Online (Sandbox Code Playgroud)
.open() 是一种方法……我怎样才能让它工作? https://github.com/ng-select/ng-select#methods