1.0.11 • Published 4 years ago

lcj v1.0.11

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

NPM

NPM包管理

本地开发

$ npm run dev

打包dist

$ npm run build

NPM发布

$ npm run pub

操作指南:

module.exports和exports和export和export default的区别,import和require的区别:

https://www.jianshu.com/p/f6c5a646c00b

export default,exports.default,module.exports,require,import整理:

https://www.jianshu.com/p/8fde36da1537

babel-plugin-add-module-exports使用:

https://www.npmjs.com/package/babel-plugin-add-module-exports

.babelrc文件中必须添加:
{
  "plugins": [
    [
      "add-module-exports",
      {
        "addDefaultProperty": true
      }
    ]
  ]
}
才可以使用:export default 或 exports.default;

getScroll组件使用:

  import { getScroll } from 'lcj';
  const {getScrollHeight, getScrollTop, getWindowHeight} = getScroll;
  
  componentWillMount () {
      window.addEventListener('scroll', () => {
          let scrollTopDistance = getScrollTop();
          let scrollBottomDistance = getScrollHeight() - getScrollTop() - getWindowHeight();
          console.log('获取页面滚动条距离顶部的距离:', scrollTopDistance);
          console.log('获取页面滚动条距离底部的距离:', scrollBottomDistance);
          }
      )
  }

参考文档:https://www.cnblogs.com/winyh/p/6715010.html

1.0.11

4 years ago

1.0.10

4 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago