src/utils/util.ts
@@ -704,6 +704,7 @@ }; export function getTextWidth(text: string, option: GetTextWidthOption) { if (!text) return 0; const { size = '14px', family = 'Microsoft YaHei' } = option; const spanEle = document.createElement('span'); document.body.appendChild(spanEle);