parent
a971369b91
commit
317c17ee88
@ -0,0 +1,15 @@
|
||||
export function generateSpel(data: {
|
||||
componentName?: string;
|
||||
methodName?: string;
|
||||
methodParams?: string;
|
||||
}) {
|
||||
const { componentName, methodName, methodParams } = data;
|
||||
if (!componentName || !methodName) {
|
||||
return '-';
|
||||
}
|
||||
|
||||
const params = methodParams ? methodParams.split(',') : [];
|
||||
const methodParamsText = params.map((item) => `#${item}`).join(',');
|
||||
|
||||
return `#{@${componentName}.${methodName}(${methodParamsText})}`;
|
||||
}
|
||||
Loading…
Reference in new issue