import{ax as s,z as a,A as e,b5 as l}from"./chunks/framework.V2ssSR2R.js";const c=JSON.parse('{"title":"DevtoolApi","description":"","frontmatter":{},"headers":[],"relativePath":"runtime-api/core/devtoolApi.md","filePath":"runtime-api/core/devtoolApi.md"}'),t={name:"runtime-api/core/devtoolApi.md"};function n(p,i,o,d,h,r){return e(),a("div",null,[...i[0]||(i[0]=[l(`

DevtoolApi

DevtoolApi@tmagic/core 提供给开发工具使用的 API 接口类。

构造函数

typescript
new DevtoolApi(options: DevtoolApiOptions)

DevtoolApiOptions

参数类型说明
appApp应用实例

实例方法

openPop

typescript
devtoolApi.openPop('dialog_1');

setDataSourceData

typescript
// 设置整个数据源数据
devtoolApi.setDataSourceData('ds_1', { name: 'test' });

// 设置数据源的某个字段
devtoolApi.setDataSourceData('ds_1', 'newValue', 'user.name');

delDataSourceData

requestDataSource

typescript
await devtoolApi.requestDataSource('http_ds_1');

getDisplayCondRealValue

callHook

typescript
await devtoolApi.callHook('button_1', 'mounted', [
  { params: { data: 'test' } },
]);

trigger

typescript
devtoolApi.trigger('button_1', {
  name: 'click',
  actions: [{ actionType: 'code', codeId: 'code_1' }]
});

updateDsl

isValueIncludeDataSource

typescript
const hasDs = devtoolApi.isValueIncludeDataSource('\${ds_1.field}');
console.log(hasDs); // true

compileDataSourceValue

typescript
const compiled = devtoolApi.compileDataSourceValue('用户名:\${ds_1.user.name}');

updateCode

typescript
devtoolApi.updateCode('code_1', 'return data.value * 2;', 'content');
`,37)])])}const g=s(t,[["render",n]]);export{c as __pageData,g as default};