jdf2e / nutui-react

京东风格的移动端 React 组件库 、支持多端小程序(A React UI Toolkit for Mobile Web)
https://nutui.jd.com/react/
920 stars 263 forks source link

Cascader组件绑定value不生效 #1301

Open wangjianbing0629 opened 1 year ago

wangjianbing0629 commented 1 year ago

NutUI scenes(nutui 场景)

小程序(@nutui/nutui-react-taro)

NutUI-react version(nutui-react 版本)

2.0.11

React version(react 版本)

18.2.0

Operating environment(运行环境)

dev:h5

Citation method(引用方式)

npm

Node version(node 版本)

16.18.1

Browser and its version(浏览器及其版本)

Chrome(106.0.5249.119)

System and its version(系统及其版本)

MacOS(12.6)

Taro environmental information(taro 环境信息)

Taro v3.6.5

Taro CLI 3.6.5 environment info: System: OS: macOS 11.6.8 Shell: 5.8 - /bin/zsh Binaries: Node: 16.18.1 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 8.19.2 - /usr/local/bin/npm npmPackages: @tarojs/cli: 3.6.7 => 3.6.7 @tarojs/components: 3.6.8 => 3.6.8 @tarojs/helper: 3.6.8 => 3.6.8 @tarojs/plugin-framework-react: 3.6.8 => 3.6.8 @tarojs/plugin-html: ^3.6.8 => 3.6.8 @tarojs/plugin-platform-alipay: 3.6.8 => 3.6.8 @tarojs/plugin-platform-h5: 3.6.8 => 3.6.8 @tarojs/plugin-platform-jd: 3.6.8 => 3.6.8 @tarojs/plugin-platform-qq: 3.6.8 => 3.6.8 @tarojs/plugin-platform-swan: 3.6.8 => 3.6.8 @tarojs/plugin-platform-tt: 3.6.8 => 3.6.8 @tarojs/plugin-platform-weapp: 3.6.8 => 3.6.8 @tarojs/react: ^3.6.8 => 3.6.8 @tarojs/runtime: 3.6.8 => 3.6.8 @tarojs/shared: 3.6.8 => 3.6.8 @tarojs/taro: 3.6.7 => 3.6.7 @tarojs/taro-loader: 3.6.8 => 3.6.8 @tarojs/webpack5-runner: 3.6.8 => 3.6.8 babel-preset-taro: 3.6.8 => 3.6.8 eslint-config-taro: 3.6.8 => 3.6.8 npmGlobalPackages: typescript: 4.9.4

Reproduction link(重现链接)

Steps to reproduce(重现步骤)

用文档上的代码也不行,绑定value,实际上Cascader不受控

What is expected?(期望的结果是什么?)

Cascader组件可根据value受控

What is actually happening?(实际的结果是什么?)

Cascader组件可根据value受控

codedart2018 commented 1 year ago

实际使用场景还必须得给一次defaultValue 都受控组件了defaultValue有点多此一举了!期望早点解决吧!