mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +08:00
fix(editor): dsl存储代码块的字段改为methods
This commit is contained in:
parent
5b220a0e06
commit
fa0149773f
@ -69,7 +69,7 @@ class CodeBlock extends BaseService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取活动的代码块dsl数据源(默认从dsl中的method字段读取)
|
||||
* 获取活动的代码块dsl数据源(默认从dsl中的methods字段读取)
|
||||
* @returns {CodeBlockDSL | null}
|
||||
*/
|
||||
public async getCodeDsl(): Promise<CodeBlockDSL | null> {
|
||||
|
@ -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) {
|
||||
|
@ -20,7 +20,7 @@ export default {
|
||||
id: '75f0extui9d7yksklx27hff8xg',
|
||||
name: 'test',
|
||||
type: 'app',
|
||||
method: {
|
||||
methods: {
|
||||
l7znj1q24wilb357ay6: {
|
||||
name: 'getData',
|
||||
content: () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user