antd--react组件库,引入后进行
npm run dev
编译的出现找不到对应的样式
ERROR in ./~/antd/lib/input/style/index.less
Module parse failed: E:\PersoanlProjects\bookreader\node_modules\antd\lib\input\style\index.less Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected character '@' (1:0)
查找了官方Issuse--Webpack css loading
handleScroll(e) {
//console.log(e);
let scrollEle = e.target.scrollingElement;
const clientHeight = scrollEle.clientHeight;
let t = scrollEle.scrollTop;
let c = this.refs.content;
let top = t <= 40 ? 40 - t : 0;
//let bottom = t >= c.height + c.offsetTop - clientHeight ? 40 : 0;
//console.log(t + "--" + c.height + "--" + c.offsetTop + "--" + clientHeight);
this.setState({
leftToolBarTop: top,
//rightToolbarBottom: bottom
});
}
constructor(props) {
super(props);
this.state = {};
this.scrollTop = 0;
this.handleScroll = this.handleScroll.bind(this)
}
componentWillMount() {
window.addEventListener('scroll', this.handleScroll);
}
componentWillUnmount() {
window.removeEventListener('scroll', this.handleScroll);
}