7 Star 66 Fork 84

ujcms / ujcms-cp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
plopfile.js 1.25 KB
一键复制 编辑 原始数据 按行查看 历史
ujcms 提交于 2023-08-30 17:22 . v8.0.2 发布
// npm run plop core user user page
// npm run plop <子系统> <分类> <模块> <page|list>
/* eslint-disable func-names */
module.exports = function (plop) {
// controller generator
plop.setGenerator('view', {
description: 'application views',
prompts: [
{
type: 'input',
name: 'sub',
message: 'sub:',
},
{
type: 'input',
name: 'path',
message: 'path:',
},
{
type: 'input',
name: 'name',
message: 'name:',
},
{
type: 'input',
name: 'type',
message: 'type:',
},
],
actions: (data) => {
const actions = [];
actions.push({
type: 'add',
path: 'src/views/{{kebabCase path}}/{{pascalCase name}}Form.vue',
templateFile: 'plop-templates/view_form.hbs',
});
actions.push({
type: 'add',
path: 'src/views/{{kebabCase path}}/{{pascalCase name}}List.vue',
templateFile: `plop-templates/view_${data.type}.hbs`,
});
actions.push({
type: 'append',
path: 'src/api/{{kebabCase path}}.ts',
templateFile: 'plop-templates/api.hbs',
data: { isList: data.type === 'list' },
});
return actions;
},
});
};
TypeScript
1
https://gitee.com/ujcms/ujcms-cp.git
git@gitee.com:ujcms/ujcms-cp.git
ujcms
ujcms-cp
ujcms-cp
master

搜索帮助