nb-request-sync
v1.0.0
Published
sync request
Downloads
2
Readme
nb-request-sync
sync request
Usage
方式一
直接在页面通过script标签引入 nb-request-sync/dist/sync-request.min.js
let datas = syncRequest({
url: '/api/v1/get-datas'
})
console.log(datas)
syncRequest({
method: 'POST',
url: '/api/v1/save-datas',
body: {
name: 'abc',
age: 18
}
})
方式二
另外一种是在模块化的工程内import nb-request-sync
import syncRequest from 'nb-request-sync'
syncRequest({
url: '/api/v1/get-datas'
})