fix(editor): dsl存储代码块的字段改为methods

This commit is contained in:
parisma 2022-09-13 16:06:03 +08:00 committed by jia000
parent 5b220a0e06
commit fa0149773f
3 changed files with 6 additions and 6 deletions

View File

@ -69,7 +69,7 @@ class CodeBlock extends BaseService {
}
/**
* dsl数据源dsl中的method字段读取
* dsl数据源dsl中的methods字段读取
* @returns {CodeBlockDSL | null}
*/
public async getCodeDsl(): Promise<CodeBlockDSL | null> {

View File

@ -763,23 +763,23 @@ class Editor extends BaseService {
}
/**
* dsl中的method字段读取活动的代码块
* dsl中的methods字段读取活动的代码块
* @returns {CodeBlockDSL | null}
*/
public async getCodeDsl(): Promise<CodeBlockDSL | null> {
const root = this.get<MApp | null>('root');
if (!root) return null;
return root.method || null;
return root.methods || null;
}
/**
* dsl的method字段
* dsl的methods字段
* @param {CodeBlockDSL} codeDsl DSL
* @returns {void}
*/
public async setCodeDsl(codeDsl: CodeBlockDSL): Promise<void> {
if (!this.state.root) return;
this.state.root.method = codeDsl;
this.state.root.methods = codeDsl;
}
private addModifiedNodeId(id: Id) {

View File

@ -20,7 +20,7 @@ export default {
id: '75f0extui9d7yksklx27hff8xg',
name: 'test',
type: 'app',
method: {
methods: {
l7znj1q24wilb357ay6: {
name: 'getData',
content: () => {