在MatSnackBar中使用"snackBar.openFromComponent()"方法时如何放置动作按钮?

How to put the action button when using the "snackBar.openFromComponent()" method in MatSnackBar?

我使用 MatSnackBar 进行通知,我希望在快餐栏中有一个操作按钮。使用时如何插入一个 "snackBar.openFromComponent()"方法?

这里是my code

您可以将操作按钮直接添加到您已附加的 stackblitz link 中的 snack-bar-component-example-snack.html

感谢 我能够解决我的问题。

这是添加了操作按钮的 working demo