roymondchen

Results 79 comments of roymondchen

需要配置[propsconfigs](https://tencent.github.io/tmagic-editor/docs/api/editor/props.html#propsconfigs) 与 [propsvalues](https://tencent.github.io/tmagic-editor/docs/api/editor/props.html#propsvalues)

自定义数据源的目录结构要跟组件一样,应该是这样 ![image](https://github.com/Tencent/tmagic-editor/assets/4327396/c4620802-a64b-4817-be41-44afc5abcc98) 然后还要与ui一样有一个index.js,内容如: ``` import xx form 'xxxx'; const ds = { key: xxxx } export default ds ```

formConfig/initValue 与组件的是一摸一样的,datasource.ts就是你写的MyDataSource

在组件的formConfig中加上type: 'data-source-select' / 'data-source-field-select',或者直接在文本输入宽中输入${数据源id.字段name}。然后再组件中的config中就可以获取到对应的数据源数据。 DataSourceManager 中的data就是所有数据源的数据,会自动赋值到config中

runtime中会监听数据源变化然后更新dsl https://github.com/Tencent/tmagic-editor/blob/20a540f0fc1db7b9c88c59db2cae3141885d9057/runtime/vue3/page/App.vue#L28 DataSourceManager 中会编译好数据源相关的数据,然后生成新的组件配置,通知runtime更新 https://github.com/Tencent/tmagic-editor/blob/20a540f0fc1db7b9c88c59db2cae3141885d9057/packages/data-source/src/createDataSourceManager.ts#L56 https://github.com/Tencent/tmagic-editor/blob/20a540f0fc1db7b9c88c59db2cae3141885d9057/packages/data-source/src/createDataSourceManager.ts#L62

迭代器内的组件用迭代的数据不需要加索引

> newNode.id==="1"代表根节点,无需进行后面的操作,不然执行到下面也会报错“未找到父节点” > ________________________________ From: ***@***.*** ***@***.***> on behalf of roymondchen ***@***.***> Sent: Thursday, January 16, 2025 2:41 PM To: Tencent/tmagic-editor ***@***.***> Cc: undefined ***@***.***>; Author ***@***.***> Subject: Re: [Tencent/tmagic-editor]...

tab可以切换页面,页面片可以被不同的页面共享

独立部署后不是每个页面都有独立的url吗?可以详细描述一下吗?