1
0
mirror of synced 2026-03-23 19:28:40 +08:00

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: () => {