jd-opensource / jd-opensource/taro-ui
AtDrawer组件 className样式不起作用
- Dominant language
- TypeScript
- Stars
- 4.7k
- Forks
- 740
- PR merge metrics
- No merged PRs in 30d
Description
### Taro UI 版本信息
2.2.1
### 问题描述
className不起作用
### 复现步骤
编译 组件文件 node_modules/taro-ui/dist/weapp/components/drawer/index.js
建议修改:使用循环的 index 变量作为 key 是一种反优化。参考:https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md
-----
100 | items.map((name, index) =>
101 | 102 | key={index}
| ^^^^^
103 | data-index={index}
104 | onClick={this.onItemClick.bind(this, index)}
105 | title={name}
### 复现代码
优先展示items里的数据
如果items没有数据就会展示children
这是自定义内容
这是自定义内容
### 报错信息
样式失效,命令行
编译 组件文件 node_modules/taro-ui/dist/weapp/components/drawer/index.js
建议修改:使用循环的 index 变量作为 key 是一种反优化。参考:https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md
-----
100 | items.map((name, index) =>
101 | 102 | key={index}
| ^^^^^
103 | data-index={index}
104 | onClick={this.onItemClick.bind(this, index)}
105 | title={name}
### 系统信息
"taro-ui": "^2.2.1"
taro
### 补充信息
Taro CLI 1.3.11 environment info:
System:
OS: macOS 10.14.5
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.15.3 - /usr/local/bin/node
Yarn: 1.16.0 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
npmPackages:
@tarojs/async-await: 1.3.11 => 1.3.11
@tarojs/components: 1.3.11 => 1.3.11
@tarojs/plugin-babel: 1.3.11 => 1.3.11
@tarojs/plugin-csso: 1.3.11 => 1.3.11
@tarojs/plugin-sass: 1.3.11 => 1.3.11
@tarojs/plugin-uglifyjs: 1.3.11 => 1.3.11
@tarojs/redux: 1.3.11 => 1.3.11
@tarojs/redux-h5: 1.3.11 => 1.3.11
@tarojs/router: 1.3.11 => 1.3.11
@tarojs/taro-alipay: 1.3.11 => 1.3.11
@tarojs/taro-swan: 1.3.11 => 1.3.11
@tarojs/taro-tt: 1.3.11 => 1.3.11
@tarojs/taro-weapp: 1.3.11 => 1.3.11
@tarojs/webpack-runner: 1.3.11 => 1.3.11
eslint-config-taro: 1.3.11 => 1.3.11
eslint-plugin-taro: 1.3.11 => 1.3.11
nerv-devtools: ^1.4.0 => 1.4.3
stylelint-config-taro-rn: 1.3.11 => 1.3.11
stylelint-taro-rn: 1.3.11 => 1.3.11
Contributor guide
Assessment
This issue has not been assessed yet.