<button (click)="onClick($event)">点我</button>

import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-bind',
  templateUrl: './bind.component.html',
  styleUrls: ['./bind.component.css']
})
export class BindComponent implements OnInit {

  constructor() { }

  ngOnInit() {
  }

  onClick($event) {
    console.log($event);
  }
}
<app-bind></app-bind>

 

相关文章:

  • 2021-06-25
  • 2022-12-23
  • 2022-12-23
  • 2022-02-09
  • 2021-10-13
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-24
  • 2021-04-02
  • 2022-01-23
相关资源
相似解决方案