【问题标题】:Vaadin: Close Notofications by "close", "ok", or "x"?Vaadin:通过“close”、“ok”或“x”关闭通知?
【发布时间】:2017-01-07 22:13:08
【问题描述】:

我正在使用 Vaadin,一切正常,但有一点我不满意:

通知(只显示消息,但没有解释用户如何关闭它。当然我可以通过点击它来关闭它,但这在我看来并不直观。

 Notification.show("message part one", "message part two", Type.ERROR_MESSAGE);

有没有办法启用关闭或确定按钮之类的功能来关闭通知?还是只是右上角的 x?

谢谢

【问题讨论】:

    标签: javascript notifications vaadin


    【解决方案1】:

    您可以显示一个 X 按钮。

    参见Valo Theme Demo,部分通知:使用附加样式“可关闭”(ValoTheme.NOTIFICATION_CLOSABLE)。

    或者,您可以在消息中包含诸如“(点击关闭)”之类的文字。

    【讨论】:

      【解决方案2】:
      .v-Notification-error {
        @include valo-notification-error-style;
        @include valo-notification-closable-style;
      }
      

      修复它。感谢 Steffen Harbich

      【讨论】:

        【解决方案3】:

        Tobi123 的解决方案在 vaadin(版本 7.6.6)中出现 sass 编译错误。

        .v-Notification-error {
           @include valo-notification-error-style('v-Notification');
           @include valo-notification-closable-style;
        }
        

        修复它。谢谢大家。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2014-08-23
          • 1970-01-01
          • 2017-03-16
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多