当我使用 antd 抽屉时。在里面,我正在使用“ui li ul”标签。对于那个“ul”滚动条只能工作停止它甚至不适用于手机和平板电脑
componentWillUpdate() {
window.addEventListener("touchmove", ontouchmove);
function ontouchmove(e) {
if (e.cancelable) {
e.preventDefault();
e.stopPropagation();
return false;
}
}
}
Run Code Online (Sandbox Code Playgroud)
import React from "react";
import "antd/dist/antd.css";
import "./index.css";
import { Drawer, Button } from "antd";
class App extends React.Component {
state = { visible: false };
componentWillUpdate() {
window.addEventListener("touchmove", ontouchmove);
function ontouchmove(e) {
if (e.cancelable) {
e.preventDefault();
e.stopPropagation();
return false;
}
}
}
showDrawer = (e) => {
this.setState({
visible: true
});
};
onClose = (e) => { …Run Code Online (Sandbox Code Playgroud)