1.4.2 • Published 3 years ago

yks-json-adapter v1.4.2

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

json-adapter

安装

npm i yks-json-adapter

方法说明

  1. execute(config):传入一个config对象,通过回调获取数据。

config对象

{
    url: "xxxxxxxx",        //请求的路径
    body: {},  				//post请求的body
    method: "get", 			//请求方式
    query: "@.success",	    //通过一条语句进行转化: lodash/jemspath
    template: null			//通过自定义模版的方式进行转化
}

例子

import {execute} from 'yks-json-adapter'

execute({
    url: "xxxxxxxx",
    body: {},
    method: "get",
    query: "@.success",
    template: null
  }).then((v) => {
    console.log(v);
  });
}
1.4.2

3 years ago

1.4.1

3 years ago

1.3.5

3 years ago

1.4.0

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.2.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago