@stbui/prophet-data-json-server
v3.0.1
Published
用于构建中后台前端应用框架
Downloads
22
Readme
@stbui/prophet-data-json-server
RESTFUL 规范适配器
Usage
npm install @stbui/prophet@latest @stbui/prophet-data-json-server@latest
配合组件使用
import { Admin, Resource } from '@stbui/prophet-core';
import dataJsonServer from '@stbui/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 '@stbui/prophet-data-json-server';
dataProvider('http://127.0.0.1')('GET_LIST', 'users').then(response => {
console.log(response);
});