2023-03-31 23:42:09 +00:00
|
|
|
import APIDocs from '@/doc/common/apidoc/index.json';
|
|
|
|
|
2023-03-31 23:44:20 +00:00
|
|
|
export const getPTOption = (name) => {
|
2023-08-07 13:14:43 +00:00
|
|
|
const { props } = APIDocs[name.toLowerCase()].interfaces.values[`${name}PassThroughOptions`] || APIDocs[name.toLowerCase()].interfaces.values[`${name}DirectivePassThroughOptions`];
|
2023-08-10 09:07:31 +00:00
|
|
|
const options = APIDocs[name.toLowerCase()].interfaces.values[`${name}PassThroughMethodOptions`];
|
2023-03-31 23:42:09 +00:00
|
|
|
let data = [];
|
|
|
|
|
|
|
|
for (const [i, prop] of props.entries()) {
|
2023-08-10 09:07:31 +00:00
|
|
|
if (options) {
|
|
|
|
data.push({
|
|
|
|
value: i + 1,
|
|
|
|
label: prop.name,
|
|
|
|
options: options?.props,
|
|
|
|
description: prop.description
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
data.push({
|
|
|
|
value: i + 1,
|
|
|
|
label: prop.name,
|
|
|
|
description: prop.description
|
|
|
|
});
|
|
|
|
}
|
2023-03-31 23:42:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return data;
|
|
|
|
};
|