首页
学习
活动
专区
圈层
工具
发布

AngularDart Material Design 是/否 按钮 顶

MaterialYesNoButtonsComponent

Selector: <material-yes-no-buttons>

两个按钮的组件水平相邻,如是/否,保存/取消,同意/不同意等。

按钮上的文字可以更改,也可以提高。 可以选择突出显示“是”按钮。

可以使用MaterialSaveCancelButtonsDirective等指令来提供基本文本自定义,该指令用保存/取消替换是/否。

要以相反顺序显示按钮,请添加reverse属性。

Inputs:

  • disabled bool  是否应禁用按钮。 默认值为false。
  • noDisplayed bool  是否应显示no按钮。 默认值为true。
  • noText String 要在取消按钮上显示的文本。 例如,Dismiss,Not now等。默认值为No.
  • pending bool 当pending为true时,隐藏yes和no按钮,并显示一个微调器。 这应该用于指示异步操作,例如保存或验证输入。 默认值为false
  • raised bool  是否应该提高按钮。 默认值为false。
  • yesDisabled bool  是否应禁用“是”按钮。 默认值为false。
  • yesDisplayed bool 是否应显示是按钮。 默认值为true。
  • yesHighlighted bool 是否应突出显示是按钮。 默认值为false。
  • yesRaised bool  是否应该凸起是按钮。 默认值为false。
  • yesText String 要在保存按钮上显示的文本。 例如,Ok,Apply等。默认值为yes。

Outputs:

  • no Stream<UIEvent>  没有按下按钮时要调用的回调。 已发布的事件是KeyboardEvent或MouseEvent
  • yes Stream<UIEvent>  按下“是”按钮时要调用的回调。 已发布的事件是KeyboardEvent或MouseEvent

MaterialSaveCancelButtonsDirective

Selector: <material-yes-no-buttons[saveCancel]>

提供来自是/否按钮的消息以进行保存/取消。

查看源码

MaterialSubmitCancelButtonsDirective

Selector: <material-yes-no-buttons[submitCancel]>

提供来自是/否按钮的默认消息以提交/取消。

查看源码

KeyUpBoundaryDirective

Selector: <[keyupBoundary]>

标记应该处理BoundaryAwareKeyUpDirective实现的keyup事件的dom子树。

查看源码

EscapeCancelsDirective

Selector: <material-yes-no-buttons[escCancels]>

如果附加到yes-no按钮,它将侦听escape keyup事件并触发无操作。

查看源码

MaterialYesNoButtonsExample

查看示例,查看源码

(adsbygoogle = window.adsbygoogle || []).push({}); function googleAdJSAtOnload() { var element = document.createElement("script"); element.src = "//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"; element.async = true; document.body.appendChild(element); } if (window.addEventListener) { window.addEventListener("load", googleAdJSAtOnload, false); } else if (window.attachEvent) { window.attachEvent("onload", googleAdJSAtOnload); } else { window.onload = googleAdJSAtOnload; }

下一篇
举报
领券