2020-10-13 17:06:51 +08:00

39 lines
866 B
TypeScript

import { InterpretDataSource } from '@ali/lowcode-types';
// 这里仅仅是数据源部分的 schema:
// @see: https://yuque.antfin-inc.com/mo/spec/spec-low-code-building-schema#XMeF5
export const DATA_SOURCE_SCHEMA: InterpretDataSource = {
list: [
{
id: 'user',
isInit: true,
type: 'fetch',
isSync: true,
options: {
uri: 'https://mocks.alibaba-inc.com/user.json',
},
},
{
id: 'orders',
isInit: true,
type: 'fetch',
isSync: true,
shouldFetch: {
type: 'JSFunction',
value: `
function (){
return false;
}
`,
},
options: {
uri: 'https://mocks.alibaba-inc.com/orders.json',
params: {
type: 'JSExpression',
value: '{ userId: this.state.user.id }',
},
},
},
],
};