iter(g276): 新增迷你趋势线组件
This commit is contained in:
@@ -78,6 +78,7 @@ import {
|
||||
skeleton,
|
||||
splitter,
|
||||
slider,
|
||||
sparkline,
|
||||
space,
|
||||
spinner,
|
||||
stepper,
|
||||
@@ -1826,6 +1827,15 @@ const content = h(
|
||||
h('span', null, '脏数据:'), relativeTime({ value: 'not-a-date' }),
|
||||
),
|
||||
),
|
||||
section(
|
||||
'sec-spark',
|
||||
'迷你趋势线',
|
||||
'sparkline:把数值序列压成一条折线,可选面积与末点标记;不画坐标轴、不带交互,只表达走向——主数值交给 statistic。',
|
||||
h('div', { class: 'row' },
|
||||
card({ title: '订单量(7 天)' }, h('div', { style: 'display:flex;align-items:center;gap:12px' }, statistic({ value: signal(1284) }), sparkline({ values: [820, 932, 901, 934, 1290, 1330, 1284], width: 140, height: 36 }))),
|
||||
card({ title: '转化率(30 天)' }, h('div', { style: 'display:flex;align-items:center;gap:12px' }, statistic({ value: signal(3.62), precision: 2, suffix: '%' }), sparkline({ values: [4.1, 3.9, 4.0, 3.8, 3.7, 3.9, 3.6], area: false }))),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
// 悬浮按钮:fixed 定位,挂 body 不参与页面布局
|
||||
|
||||
Reference in New Issue
Block a user