wujingjing
2025-02-11 6aa0cd448fc05f755033b7436aef591b0f7fa214
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const { notEmpty } = require('../utils.js');
 
module.exports = {
    description: 'generate a view',
    prompts: [
        {
            type: 'input',
            name: 'name',
            message: 'view name please',
            validate: notEmpty('name'),
        },
    ],
    actions: (data) => {
        const name = '{{name}}';
        const actions = [
            {
                type: 'add',
                path: `src/views/project/yw/systemManage/${name}/index.vue`,
                templateFile: 'plop-templates/view/index.hbs',
                data: {
                    name: name,
                },
            },
        ];
 
        return actions;
    },
};