iter(g282): 代码块支持长行折行
This commit is contained in:
@@ -26,5 +26,5 @@ export function codeBlock(props: CodeBlockProps): HTMLElement {
|
||||
title ? h('span', { class: 'ua-code-title' }, title) : h('span', null, ''),
|
||||
props.copyable === false ? null : copyButton({ text: props.code, label: '复制', size: 'sm', variant: 'ghost', onCopied: props.onCopy }),
|
||||
);
|
||||
return h('div', { class: 'ua-code', role: 'group', 'aria-label': props.ariaLabel ?? '代码块' }, head, body);
|
||||
return h('div', { class: `ua-code${props.wrap ? ' is-wrap' : ''}`, role: 'group', 'aria-label': props.ariaLabel ?? '代码块' }, head, body); // is-wrap 只改折行,行号与缩进不动
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user