|
@@ -14,14 +14,17 @@ module.exports = (data) => {
|
|
|
const { title, type, required = false, remark, index, def, zh, ref, getProp } = columns[i];
|
|
|
let refStr;
|
|
|
if (ref) {
|
|
|
- const propList = getProp.split(';');
|
|
|
- let propStr = '[';
|
|
|
- for (const p of propList) {
|
|
|
- if (p !== _.head(propList)) propStr = `${propStr}, `;
|
|
|
- propStr = `${propStr}'${p}'`;
|
|
|
+ refStr = ` ref: '${_.capitalize(ref)}'`;
|
|
|
+ if (getProp) {
|
|
|
+ const propList = getProp.split(';');
|
|
|
+ let propStr = '[';
|
|
|
+ for (const p of propList) {
|
|
|
+ if (p !== _.head(propList)) propStr = `${propStr}, `;
|
|
|
+ propStr = `${propStr}'${p}'`;
|
|
|
+ }
|
|
|
+ propStr += ']';
|
|
|
+ refStr = `, getProp: ${propStr}`;
|
|
|
}
|
|
|
- propStr += ']';
|
|
|
- refStr = `ref: '${_.capitalize(ref)}', getProp: ${propStr}`;
|
|
|
}
|
|
|
const str = ` ${title}: { type: ${type || 'String'}, required: ${required} ${type === 'Secret' ? ', select: false' : ''} ${def ? `, default: '${def}'` : ''}${
|
|
|
zh ? `, zh: '${zh}'` : ''
|