Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>e-cliNew to Visual Studio Code? Get it now.
e-cli

e-cli

liuyang

|
128 installs
| (0) | Free
to load config create files
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

e-cli

根据e-config.js的配置文件自动生成文件结构

配置

1.e-config.js

将e-config.js放置项目的根目录 如下

module.exports = {
    component: {
        templateDirPath: './.vscode/templates'  // 模版路径
    },
    folder: {
        templateDirPath: './.vscode/folders'  // 模版路径
    }
}

插件会在vscode内置命令, e-component(对应component配置)、e-folder(对应folder配置)

2.template

模版选用, 在e-config.js里有template的路径 可以在根目录下新建templates文件夹, 添加你需要的模版; 模版里写的内置变量COMPONENT_NAME、COMPONENT_CAP_NAME、cOMPONENT_NAME(大驼峰、全大写、小驼峰)成你输入值 模版示例

import React, { useMemo, useState, useEffect } from 'react';
import s from './COMPONENT_NAME.module.less';


const COMPONENT_NAME: React.FC = () => {

  useEffect(() => {
   
  }, []);

  return (
    <div className={s.cOMPONENT_NAME}></div>
  );
};

export default COMPONENT_NAME;
  

COMPONENT_NAME、COMPONENT_CAP_NAME、cOMPONENT_NAME将被替换成你输入文件

3.触发插件

在资源栏右键触发,在下拉选项中有e-component(对应component配置)、e-folder(对应folder配置)会出现一个输入框, 输入你想创建的组件

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft