[英]dropdown list not working properly on small mobile screen using react bootstrap
使用react bootstrap下拉列表在小屏幕(移动设备)上具有下拉列表的用户体验非常糟糕。
有没有针对这种情况的库,某种形式的操作表看起来更像是本机的reactjs。
是否可以在React中集成任何使用html,css,javascript的库?
好的,在讨论之后,我认为我们为您的问题找到了完美的解决方案。
您可以像这样使用->
import Actionsheet from 'react-actionsheet';
class App extends Component {
state = {
show: false
}
onClick = () => {
const { show } = this.state
this.setState({show: !show})
}
onRequestClose = () => {
this.onClick()
}
render() {
const { show } = this.state
const tip = show ? '隐藏' : '显示'
const menus = [{content: '点我'}, {content: '不要点我'}]
return (
<div>
<button onClick={this.onClick}>{tip}</button>
<Actionsheet show={show} menus={menus} onRequestClose={this.onRequestClose} />
</div>
)
}
}
这样将呈现UI
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.