NervJS / taro-ui

一款基于 Taro 框架开发的多端 UI 组件库
https://taro-ui.taro.zone
MIT License
4.55k stars 754 forks source link

taro 3.0.8 "taro-ui": "^3.0.0-alpha.3" 微信小程序 AtIndexes 组件点击索引列表有时无法跳转到指定索引 #1186

Open liuyunzyj opened 4 years ago

liuyunzyj commented 4 years ago

跟官方代码一模一样

import Taro from '@tarojs/taro' import { View } from '@tarojs/components' import { AtIndexes, AtSearchBar } from 'taro-ui' import mockData, { CityItem } from './mock-data' import './index.scss'

interface IndexesState { value: string }

export default class Index extends Taro.Component<{}, IndexesState> { public config: Taro.PageConfig = { navigationBarTitleText: 'Taro UI' }

public constructor () { super(...arguments) this.state = { value: '' } }

public componentDidMount (): void { console.log(this.scrollIntoView) // this.scrollIntoView && this.scrollIntoView('top', 0) }

private scrollIntoView (key: string): void { console.log('不需要实际实现', key) }

private onClick (item: CityItem): void { console.log(item) }

private handleActionClick (): void { if (!this.state.value) { return } this.setState({ value: '' }) this.scrollIntoView && this.scrollIntoView(this.state.value.toUpperCase()) }

private handleChange (value: string): void { this.setState({ value }) }

public render (): JSX.Element { return (

{/* 基础用法 */} { this.scrollIntoView = fn }} > 用户自定义内容
)

} }

taro-ui-bot[bot] commented 4 years ago

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

ZhuyuAndCoder commented 4 years ago

同样问题+1

ZadaWu commented 3 years ago

同样问题+1

ZadaWu commented 3 years ago

同样问题+1

xiShiForget commented 3 years ago

同样问题+