1.1.0 • Published 8 years ago

jrbasic v1.1.0

Weekly downloads
1
License
ISC
Repository
-
Last release
8 years ago

#jrbasic

npm install jrbasic --save

#简融基础

  /*fetch请求*/
  export const jrRequest = _jrRequest;
  export const getFetchPromise = _getFetchPromise;
  export const fetchGet = _fetchGet;
  export const fetchPost = _fetchPost;
  export const AjaxGet = _AjaxGet;
  export const AjaxPost = _AjaxPost;
  /*others其他*/
  export const remSet = _remSet;
  export const searchToObj = _searchToObj;
  export const checkTel = _checkTel;
  export const isIosAndroid = _isIosAndroid;
  /*log埋点*/
  export const addJrLog = _addJrLog;
  export const addGrowingLog = _addGrowingLog;
  /*cookie操作*/
  export const setCookie = _setCookie;
  export const getCookie = _getCookie;
  

#使用

import { jrRequest, AjaxPost, AjaxGet, remSet } from 'jrbasic';

###设置页面的rem单位

remSet(document, window);  设计稿宽度为375px  1rem相当于20px 

###路由参数转换

searchToObj("?letter=2&opp=23") ==>>> {letter:2, opp:23}

###action示例

export const getBanner = () => {
  return function (dispatch) {
      jrRequest({
          requestType: 'GET', /*请求方法GET/POST 不指定默认GET*/
          dispatch: dispatch, /*dispatch方法 必传参数*/
          jrApi: apiGetBanner, /*Api url 请求地址*/
          fetchPrm: {hello: '2'}, /*请求参数object形式*/
          requestingAction: requestPosts, /*请求过程中的action钩子*/
          successAction: bannerImagesSet, /*请求成功后的action钩子 必传*/
          errorAction: errorPosts, /*请求失败的action*/
          extra: extra /*action的第二个参数 自己定义*/
      });
  }
};

###基础动画样式(animate简融版)

引用方式 使用方式, 只需引用一次即可 不需要每个组件都import

import 'jrbasic/jrAnimate.less'

...

<p class="animated hinge flash">hello world</p>
<p class="animated bounceIn pulse">hello world</p>
<p class="animated fadeIn">hello world</p>
<p class="animated fadeInDown">hello world</p>
<p class="animated fadeOut">hello world</p>

使用例子参照包里的jrAnimateExample.html

或者 https://daneden.github.io/animate.css/

1.1.0

8 years ago

1.0.41

8 years ago

1.0.40

8 years ago

1.0.39

8 years ago

1.0.37

8 years ago

1.0.36

8 years ago

1.0.35

8 years ago

1.0.34

8 years ago

1.0.33

8 years ago

1.0.32

8 years ago

1.0.31

8 years ago

1.0.30

8 years ago

1.0.28

8 years ago

1.0.27

8 years ago

1.0.26

8 years ago

1.0.25

8 years ago

1.0.24

8 years ago

1.0.23

8 years ago

1.0.22

8 years ago

1.0.21

8 years ago

1.0.20

8 years ago

1.0.19

8 years ago

1.0.18

8 years ago

1.0.17

8 years ago

1.0.16

8 years ago

1.0.14

8 years ago

1.0.13

8 years ago

1.0.11

8 years ago

1.0.10

8 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago