📅  最后修改于: 2022-03-11 15:01:44.195000             🧑  作者: Mango
import { ToastrService } from 'ngx-toastr'; @Component({...})export class YourComponent { constructor(private toastr: ToastrService) {} showSuccess() { this.toastr.success('Hello world!', 'Toastr fun!'); }}