Skip to content

Commit

Permalink
feat(com): components should not use cssModules
Browse files Browse the repository at this point in the history
  • Loading branch information
dingff committed Jul 13, 2023
1 parent c3e96d4 commit ff87414
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const config = {
| 参数项 | 类型 | 说明 | 默认值 |
| :-----| :---- | :---- | :---- |
| css | string | 指定 css 预处理器,可选 ```none```, ```sass```, ```less```, ```stylus``` | ```sass```|
| cssModules | boolean | 是否开启 cssModules,可选 ```true```, ```false``` | ```true``` |
| cssModules | boolean | 是否开启 cssModules(只针对页面生效),可选 ```true```, ```false``` | ```true``` |
| typescript | boolean | 是否使用 typescript,可选 ```true```, ```false``` | ```false``` |
| hooks | boolean | 是否使用 hooks,可选 ```true```, ```false``` | ```false``` |
| createConfigFile | boolean | 是否单独创建页面配置文件,可选 ```true```, ```false``` | ```true``` |
Expand Down
3 changes: 1 addition & 2 deletions src/generators/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,12 @@ interface P {
componentPath: string;
appPath: string;
chalk: any;
cssModules: boolean;
typescript: boolean;
hooks: boolean;
componentTpl: string;
styleTpl: string;
}
export function componentGenerator({
cssModules,
componentPath,
appPath,
chalk,
Expand All @@ -75,6 +73,7 @@ export function componentGenerator({
componentTpl,
styleTpl,
}: P) {
const cssModules = false
const jsExt = typescript ? 'tsx' : 'jsx'
const pathArr = componentPath.split('/')
const componentName = upperFirst(pathArr.pop() ?? '')
Expand Down

0 comments on commit ff87414

Please sign in to comment.