You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
579 B

/**
* @author LeonZhu
* @description 内置模板
*/
import * as _ from 'lodash';
import { getTemplatesDirFile } from './utils';
export const templateRegistion = [
{
templateType: 'fetch',
templateFileName: 'fetch.ts'
},
{
templateType: 'hooks',
templateFileName: 'hooks.ts'
}
];
export function getTemplateByTemplateType(templateType = 'fetch') {
const templateObj = templateRegistion.find(template => templateType === template.templateType);
if (templateObj) {
return getTemplatesDirFile(templateObj.templateFileName);
}
return '';
}