You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
当前场景与局限
当前使用 pnpm g 命令(例如执行 pnpm g modal)时,会自动在 components 目录下创建组件文件夹,并生成 4 个固定文件。
该功能虽大幅提升了组件初始化效率,但存在一个关键局限:这 4 个生成文件的代码内容是固定的,无法自定义。
在实际项目开发中,不同业务场景不同人员往往需要不同的初始代码结构(比如在 modal.json 中添加特定配置项、在 modal.ts 中导入常用工具函数、在 modal.scss 中预设默认样式模板等)。
固定的生成内容导致开发者在生成文件后,还需手动修改内容,增加了重复工作量,降低了开发效率。
Beta Was this translation helpful? Give feedback.
All reactions