Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

表单 Form设置'auto'时标签无法重新自动计算字段宽度 #5939

Open
5 tasks done
maddenBoy opened this issue May 11, 2024 · 1 comment
Open
5 tasks done
Labels
untriaged need to sort

Comments

@maddenBoy
Copy link

maddenBoy commented May 11, 2024

描述错误

有些场景下可能需要异步的获取某些FormItem项,或者部分FormItem项只有在某些条件满足的情况下才显示, 在表单 Form设置'auto'时,表单无法重新自动计算FormItem宽度导致无法正常显示,希望可以提供重新自动更新label width的方法

复现步骤

1、打开https://codesandbox.io/p/sandbox/cranky-rumple-vjxn2n?file=%2Fsrc%2FDemo.vue%3A79%2C26
2、切换显示/隐藏电话号码

隐藏电话号码字段后,剩余字段宽度不会重新计算(往左移)

image

最小复现链接

https://codesandbox.io/p/sandbox/cranky-rumple-vjxn2n?file=%2Fsrc%2FDemo.vue%3A79%2C26

系统信息

System:
    OS: Windows 11 10.0.22631
    CPU: (16) x64 AMD Ryzen 9 5900HX with Radeon Graphics        
    Memory: 19.47 GB / 31.40 GB
  Binaries:
    Node: 14.16.0 - ~\AppData\Local\Volta\tools\image\node\14.16.0\node.EXE
    Yarn: 1.22.19 - C:\Program Files\Volta\yarn.EXE
    npm: 6.14.11 - ~\AppData\Local\Volta\tools\image\node\14.16.0\npm.CMD
    pnpm: 8.14.1 - C:\Program Files\Volta\pnpm.EXE    
  Browsers:
    Edge: Chromium (123.0.2420.97)
    Internet Explorer: 11.0.22621.3527
  npmPackages:
    naive-ui: 2.38.1 => 2.38.1
    vue: ^3.2.39 => 3.2.39

使用的包管理器

pnpm

验证

@maddenBoy maddenBoy added the untriaged need to sort label May 11, 2024
@wikipine
Copy link

WX20240516-164323@2x
我是重新设置一个key解决类似这种问题,强制让它重新渲染

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged need to sort
Projects
None yet
Development

No branches or pull requests

2 participants