iter(e03): 新增 rate 评分组件
This commit is contained in:
@@ -19,6 +19,7 @@ import {
|
||||
popover,
|
||||
progress,
|
||||
radioGroup,
|
||||
rate,
|
||||
select,
|
||||
showToast,
|
||||
skeleton,
|
||||
@@ -119,6 +120,9 @@ const qty = signal(1);
|
||||
// —— 步骤条:下单流程演示,按钮推进、点已完成步骤回跳 ——
|
||||
const stepIdx = signal(0);
|
||||
|
||||
// —— 评分:满意度演示,与只读实例共用同一信号 ——
|
||||
const score = signal(0);
|
||||
|
||||
// —— 受控选中:dataTable 内部勾选实时写回,外部可清空 ——
|
||||
const picked = signal<RowKey[]>([]);
|
||||
|
||||
@@ -363,6 +367,18 @@ const content = h(
|
||||
button({ label: '下一步', disabled: computed(() => stepIdx() === 2), onClick: () => stepIdx(Math.min(2, stepIdx() + 1)) }),
|
||||
),
|
||||
),
|
||||
section(
|
||||
'sec-rate',
|
||||
'评分',
|
||||
'rate:点选星标打分,悬停预览移出还原,键盘 →/↑ 加分 ←/↓ 减分,disabled 只读展示。',
|
||||
h(
|
||||
'div',
|
||||
{ class: 'row' },
|
||||
rate({ value: score, onChange: (v) => toast.info(`评分 ${v} 星`) }),
|
||||
h('span', { class: 'out' }, () => `当前:${score() || '未评分'}`),
|
||||
),
|
||||
h('div', { class: 'row' }, rate({ value: score, disabled: true })),
|
||||
),
|
||||
section(
|
||||
'sec-menu',
|
||||
'下拉菜单',
|
||||
|
||||
Reference in New Issue
Block a user