mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-09-19 03:55:50 +08:00
feat(editor): 方法参数支持选择数据源字段
This commit is contained in:
parent
ecfaff2e0d
commit
6cdeaa0c1b
@ -44,7 +44,17 @@ const getFormConfig = (items: FormConfig = []) => [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const codeParamsConfig = computed(() => getFormConfig(props.paramsConfig));
|
const codeParamsConfig = computed(() =>
|
||||||
|
getFormConfig(
|
||||||
|
props.paramsConfig.map(({ name, text, extra, ...config }) => ({
|
||||||
|
type: 'data-source-field-select',
|
||||||
|
name,
|
||||||
|
text,
|
||||||
|
extra,
|
||||||
|
fieldConfig: config,
|
||||||
|
})),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 参数值修改更新
|
* 参数值修改更新
|
||||||
|
@ -41,7 +41,7 @@ export const useDataSourceMethod = () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let codeContent = method.content;
|
let codeContent = method.content || `({ params, dataSource, app }) => {\n // place your code here\n}`;
|
||||||
|
|
||||||
if (typeof codeContent !== 'string') {
|
if (typeof codeContent !== 'string') {
|
||||||
codeContent = codeContent.toString();
|
codeContent = codeContent.toString();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user