rv54ntjwfm3ug8

你们习惯给每个 component 都建一个独立的目录吗?为什么?

  •  
  •   rv54ntjwfm3ug8 · Apr 18, 2022 · 2302 views
    This topic created in 1670 days ago, the information mentioned may be changed or developed.

    本来应该发 Angular 节点的,但那里太冷清了就挪过来了

    1 )

    .\layout\layout.component.[css|ts|html|spec.ts]
    .\layout\side-nav.component.[css|ts|html|spec.ts]
    .\layout\top-bar.component.[css|ts|html|spec.ts]
    

    还是 2 )

    .\layout\layout.component.[css|ts|html|spec.ts]
    .\layout\side-nav\side-nav.component.[css|ts|html|spec.ts]
    .\layout\top-bar\top-bar.component.[css|ts|html|spec.ts]
    

    又或是 3 ):

    .\layout\layout\layout.component.[css|ts|html|spec.ts]
    .\layout\side-nav\side-nav.component.[css|ts|html|spec.ts]
    .\layout\top-bar\top-bar.component.[css|ts|html|spec.ts]
    

    或者还有第 4 种?

    6 replies  •  2022-04-28 11:04:18 +08:00
    a935855375
    a935855375
    Apr 18, 2022
    1
    第二种,结构层次最舒服
    Chism
    Chism
    Apr 18, 2022 via Android
    2
    react 和 vue 我会,这样 css 等自用的文件避免跟其它混淆,ag 没用过。。
    shakaraka
    shakaraka
    Apr 18, 2022
    3
    2.每个组件一个目录,或者每个模块一个目录,针对 ng
    susan0007
    susan0007
    Apr 19, 2022
    4
    我用 react 会选择第一种,因为只有一个 tsx 文件。
    对于组件文件数量大于 2 的,我会选第二种。
    linkopeneyes
    linkopeneyes
    Apr 20, 2022
    5
    第二种啊
    renhou
    renhou
    Apr 28, 2022
    6
    比较常用第二种
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2313 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 04:05 · PVG 12:05 · LAX 20:05 · JFK 23:05
    ♥ Do have faith in what you're doing.