直接跳到内容

Alert 警告

警告组件用于提供针对典型用户操作的上下文反馈消息,具有多种可用且灵活的警告消息样式。

底层实现为panel.pane.Alert,参数基本一致,参考文档:https://panel.holoviz.org/reference/panes/Alert.html

基本用法

PnAlert 支持 Markdown 和 HTML 语法:

不同类型

PnAlert 组件有多种 alert_type 选项,用于控制警告消息的颜色:

长文本消息

它也可以用于较长的消息:

API

属性

属性名说明类型默认值
alert_type警告类型str  'primary', 'secondary', 'success', 'danger', 'warning', 'info', 'light', 'dark''primary'
sizing_mode尺寸调整模式str 'fixed'
width宽度int, str None
height高度int, str None
min_width最小宽度int None
min_height最小高度int None
max_width最大宽度int None
max_height最大高度int None
margin外边距int, tuple 5
css_classesCSS类名列表list []

Controls

src/examples/panel_vuepy/panes/Alert

Alert 警告已经加载完毕