这个怎么样:
stackblitz
export class AppComponent {
opened = false;
dostuff = false;
toggle(){
this.opened = !this.opened
if(!this.opened) this.dostuff = false;
}
mouseInside(event){
this.dostuff = true;
event.preventDefault();
}
focusOut(){
if (!this.dostuff) {
this.opened = false;
}
}
onFileChange(event) {
this.opened = false;
this.dostuff = false;
}
}