prophet-data-json-server
v0.4.6
Published
用于构建中后台前端应用框架
Downloads
10
Readme
data-json-server
RESTFUL 规范适配器
Usage
npm install --save @prophet-data-json-server
配合组件使用
import { Admin, Resource } from 'prophet-core';
import dataJsonServer from 'prophet-data-json-server';
<Admin dataProvider={dataJsonServer('http://127.0.0.1:3001')}>
<Resource
name="users"
list={props => <div>list</div>}
edit={props => <div>edit</div>}
create={props => <div>create</div>}
show={props => <div>show</div>}
/>
</Admin>;
直接调用
import dataProvider from 'prophet-data-json-server';
dataProvider('http://127.0.0.1')('GET_LIST', 'users').then(response => {
console.log(response);
});