支持在配置文件中为每一个函数指定特有参数

This commit is contained in:
fofolee
2025-01-07 12:08:42 +08:00
parent 1c35b6fdd8
commit 5c2d9a5d89
5 changed files with 27 additions and 7 deletions

View File

@@ -34,8 +34,20 @@ export default defineComponent({
localCommand() {
return this.modelValue;
},
// 通用参数配置
commonConfig() {
return this.modelValue.config || [];
},
// 特定函数独有参数配置
functionConfig() {
return (
this.modelValue.functionSelector?.options.find(
(item) => item.value === this.funcName
)?.config || []
);
},
localConfig() {
return (this.modelValue.config || []).map((item) => {
return [...this.commonConfig, ...this.functionConfig].map((item) => {
return {
...item,
value: item.defaultValue,