iter(g131): 新增悬浮操作按钮 floatButton
This commit is contained in:
@@ -31,6 +31,7 @@ import {
|
||||
divider,
|
||||
drawer,
|
||||
empty,
|
||||
floatButton,
|
||||
image,
|
||||
form,
|
||||
formItem,
|
||||
@@ -1305,6 +1306,23 @@ const content = h(
|
||||
card({ title: zone }, typography({ content: '健康检查通过', type: 'success', variant: 'paragraph' }))),
|
||||
),
|
||||
),
|
||||
section(
|
||||
'sec-floatbutton',
|
||||
'悬浮操作按钮',
|
||||
'floatButton 停靠左下 / 右下角:只给 icon 是圆形,配 label 变胶囊,badge 走角标,tooltip 兼作 aria-label。它返回的是 fixed 包裹层,挂到 body 才不会被容器 overflow 裁掉。',
|
||||
grid({ min: '240px' },
|
||||
card({ title: '本页已挂两个' },
|
||||
typography({ variant: 'paragraph', type: 'secondary', content: '左下角「+ 新建工单」是图标 + 文字胶囊,点击弹提示;右下角「?」是纯图标圆形并带角标 3,悬停看 title。' }),
|
||||
typography({ variant: 'paragraph', content: h('span', null, '右下角同时有 backTop,所以这里改用 ', typography({ content: "position: 'left-bottom'", code: true }), ' 错开。') }),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
// 悬浮按钮:fixed 定位,挂 body 不参与页面布局
|
||||
document.body.append(
|
||||
floatButton({ icon: '+', label: '新建工单', tooltip: '新建工单', position: 'left-bottom', onClick: () => toast.success('已新建工单') }),
|
||||
floatButton({ icon: '?', tooltip: '帮助中心(3 条待读)', badge: 3, onClick: () => toast.info('打开帮助中心') }),
|
||||
);
|
||||
|
||||
// 引导漫游实例:根节点需挂到 body(fixed 定位,不参与布局)
|
||||
|
||||
Reference in New Issue
Block a user