jd-opensource / jd-opensource/taro-ui

AtTabs遍历AtTabsPane, AtTabsPane中再遍历数据某个list,第二层遍历中拿不到遍历的list

Open
#842 4 comments 0 reactions 0 assignees View on GitHub
stale
Dominant language
TypeScript
Stars
4.7k
Forks
740
PR merge metrics
No merged PRs in 30d

Description

### Taro UI 版本信息

2.2.2

### 问题描述

AtTabs遍历AtTabsPane, AtTabsPane中再遍历数据某个list,第二层遍历中拿不到遍历的list

### 复现步骤

复制官方代码,https://taro-ui.aotu.io/#/docs/tabs, 然后改成遍历AtTabsPane

### 复现代码
```
import Taro from '@tarojs/taro'
import { View } from '@tarojs/components'
import { AtTabs, AtTabsPane } from 'taro-ui'

export default class Index extends Taro.Component {
constructor () {
super(...arguments)
this.state = {
current: 0,
}
}
handleClick (value) {
this.setState({
current: value
})
}
render () {
const tabList = [{ title: '标签页1' }, { title: '标签页2' }, { title: '标签页3' }]
return (

{
tabList.map((tab, i) => {
const list = ['苹果', '香蕉', '橘子']
return (

{
list.map((item) => {
console.log(list);
return ({item})
})
}

)
})
}

)
}
}
```

### 报错信息

拿不到第二层遍历的list,很奇怪

### 系统信息

👽 Taro v1.3.18

Taro CLI 1.3.18 environment info:
System:
OS: macOS High Sierra 10.13.6
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.15.3 - ~/.nvm/versions/node/v10.15.3/bin/node
Yarn: 1.16.0 - /usr/local/bin/yarn
npm: 6.9.0 - ~/.nvm/versions/node/v10.15.3/bin/npm
npmPackages:
@tarojs/async-await: 1.3.18 => 1.3.18
@tarojs/components: 1.3.18 => 1.3.18
@tarojs/plugin-babel: 1.3.18 => 1.3.18
@tarojs/plugin-csso: 1.3.18 => 1.3.18
@tarojs/plugin-less: 1.3.18 => 1.3.18
@tarojs/plugin-sass: ^1.3.18 => 1.3.18
@tarojs/plugin-uglifyjs: 1.3.18 => 1.3.18
@tarojs/redux: 1.3.18 => 1.3.18
@tarojs/redux-h5: 1.3.18 => 1.3.18
@tarojs/router: 1.3.18 => 1.3.18
@tarojs/taro: 1.3.18 => 1.3.18
@tarojs/taro-alipay: 1.3.18 => 1.3.18
@tarojs/taro-h5: 1.3.18 => 1.3.18
@tarojs/taro-swan: 1.3.18 => 1.3.18
@tarojs/taro-tt: 1.3.18 => 1.3.18
@tarojs/taro-weapp: 1.3.18 => 1.3.18
@tarojs/webpack-runner: 1.3.18 => 1.3.18
eslint-config-taro: 1.3.18 => 1.3.18
eslint-plugin-taro: 1.3.18 => 1.3.18
nerv-devtools: ^1.4.0 => 1.4.4
nervjs: ^1.4.0 => 1.4.4
stylelint-config-taro-rn: 1.3.18 => 1.3.18
stylelint-taro-rn: 1.3.18 => 1.3.18

### 补充信息

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.