1.1.0 • Published 7 years ago

jrbasic v1.1.0

Weekly downloads
1
License
ISC
Repository
-
Last release
7 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

7 years ago

1.0.41

7 years ago

1.0.40

7 years ago

1.0.39

7 years ago

1.0.37

7 years ago

1.0.36

7 years ago

1.0.35

7 years ago

1.0.34

7 years ago

1.0.33

7 years ago

1.0.32

7 years ago

1.0.31

7 years ago

1.0.30

7 years ago

1.0.28

7 years ago

1.0.27

7 years ago

1.0.26

7 years ago

1.0.25

7 years ago

1.0.24

7 years ago

1.0.23

7 years ago

1.0.22

7 years ago

1.0.21

7 years ago

1.0.20

7 years ago

1.0.19

7 years ago

1.0.18

7 years ago

1.0.17

7 years ago

1.0.16

7 years ago

1.0.14

7 years ago

1.0.13

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago