antd--react組件庫,引入後進行
npm run dev
編譯的出現找不到對應的樣式css
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 loadingnode
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); }
React怎麼綁定scroll事件?react