首页 > 解决方案 > 为空时的ant design输入方向

问题描述

rtl当输入值为空时如何设置输入方向,auto否则。

https://codesandbox.io/s/antd-input-direction-lofk3

标签: reactjsinputantdright-to-left

解决方案


你可能会做这样的事情。我放置了一个 useState 来处理输入的值,并使用模板文字条件运算符对其做出反应

https://codesandbox.io/s/antd-input-direction-forked-dogr1


推荐阅读