💄 修复特定条件下的渲染异常

This commit is contained in:
目棃
2024-09-05 18:36:51 +08:00
parent 78a9599066
commit 41f93a0c12

View File

@@ -55,12 +55,16 @@ function getTitle(): string {
function getLineStyle(): StyleValue {
const style = <Array<StyleValue>>[];
const ruleInline: StyleValue = "display: inline";
if (props.data.attributes === undefined) {
style.push(ruleInline);
return style;
}
if (props.data.attributes.align) {
const ruleAlign: StyleValue = `textAlign: ${props.data.attributes.align}`;
style.push(ruleAlign);
} else {
style.push(ruleInline);
}
return style;
}