ant-design / ant-design-mobile-rn

Ant Design for React Native

Home Page:https://rn.mobile.ant.design/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

switch中checked属性设置

Torstentjh opened this issue · comments

commented

💬 前提强调

  • I have searched the issues of this repository and believe that this is not a duplicate.

🙋 描述详情/重现步骤

image
image
你好,我在使用switch组件时,发现有checked和defaultchecked两个,貌似和文档中说明是一样的,都只能设置默认选中,为了方便观看,我将led灯位置和警报位置的checked设置为一样,还给led灯设置了loading,然后我用第一个按钮控制,测试发现loading和disable都能实现,但是就是无法控制开关的状态,是因为checked和defaultchecked这两个都只能设置默认状态,无法更改吗

💻 运行环境

Android

⚫️ npx react-native info输出信息

System:
OS: Windows 11 10.0.22000
CPU: "(12) x64 AMD Ryzen 5 4600H with Radeon Graphics "
Memory: 3.90 GB / 15.87 GB
Binaries:
Node:
version: 18.12.1
path: E:\tnode\node.EXE
Yarn:
version: 1.22.21
path: E:\tools\nvm\nvm\node_global\yarn.CMD
npm:
version: 8.19.2
path: E:\tnode\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK:
AllowDevelopmentWithoutDevLicense: Enabled
AllowAllTrustedApps: Enabled
IDEs:
Android Studio: Not Found
Visual Studio: Not Found
Languages:
Java: 17.0.6
Ruby: Not Found
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.72.6
wanted: 0.72.6
react-native-windows: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: Not found
newArchEnabled: Not found

补充说明

No response

历史设计如此,近期会修改更新

support in 5.1.0