0.6.2 • Published 5 years ago

zp-ui v0.6.2

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

UI工具

npm Build Status

主要目录结构

  • constants,常量
  • src
    • carousel
    • group,通用类
    • imageLoader
    • modal
    • swipe
    • swipeCarousel
  • styles
    • _func.scss
    • _root.scss

其中_func.scss$rem默认100px,可设置覆盖

Observer

使用观察者模式管理状态切换

自定义观察者(observer)必须包含update方法,接收目标(subject)的当前状态和原状态。使用目标实例方法attach(), detach()管理观察者,参数接收(Observer|Array.<Observer>)

const customObserver = () => ({
  update(state, prevState) {
    const { page: currentPage } = state;
    const { page: prevPage } = prevState;

    if (prevPage !== currentPage && currentPage === 'main') {
      doSth();
    }
  },
});

const menu = new Menu('main');
menu.attach(customObserver());

menu添加自定义观察者示例。当menu状态切换到打开main页时将执行doSth函数。

browserslist

浏览器支持情况

npx browserslist

见.browserslistrc

测试和文档

测试和文档

npm test

运行单元测试

npm run jsdoc

# darwin
npm run open

生成和查看doc

资源

0.6.2

5 years ago

0.6.1

5 years ago

0.6.0

5 years ago

0.5.2

6 years ago

0.5.1

6 years ago

0.5.0

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.0

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago