fix: 默认word-break: break-word;会导致json预览样式异常

This commit is contained in:
dap 2024-12-05 16:08:56 +08:00
parent 4df62b563e
commit 827ef2e403
2 changed files with 5 additions and 8 deletions

View File

@ -157,12 +157,15 @@ export const descSchema: DescItem[] = [
field: 'method', field: 'method',
label: '方法', label: '方法',
}, },
/**
* word-break: break-word;json预览样式异常
*/
{ {
field: 'operParam', field: 'operParam',
label: '请求参数', label: '请求参数',
render(value) { render(value) {
return ( return (
<div class="max-h-[300px] overflow-y-auto"> <div class="max-h-[300px] overflow-y-auto break-normal">
{renderJsonPreview(value)} {renderJsonPreview(value)}
</div> </div>
); );
@ -173,7 +176,7 @@ export const descSchema: DescItem[] = [
label: '响应参数', label: '响应参数',
render(value) { render(value) {
return ( return (
<div class="max-h-[300px] overflow-y-auto"> <div class="max-h-[300px] overflow-y-auto break-normal">
{renderJsonPreview(value)} {renderJsonPreview(value)}
</div> </div>
); );

View File

@ -30,9 +30,3 @@ function handleOpenChange(open: boolean) {
<Description @register="registerDescription" /> <Description @register="registerDescription" />
</BasicDrawer> </BasicDrawer>
</template> </template>
<style lang="scss" scoped>
.ant-descriptions :deep(.ant-descriptions-item-content) {
word-break: normal;
}
</style>