lifesimple
V2EX  ›  Vue.js

vue 组件名以及 prop 写法你们都怎么选的呢 团队都怎么统一的呢

  •  
  •   lifesimple · Aug 17, 2022 · 2212 views
    This topic created in 1548 days ago, the information mentioned may be changed or developed.
    1. MyComp
    2. my-comp

    prop 也是,感觉 my-comp 这种写法虽然代码里看起来简洁点,但是调试问题的时候搜的时候下意识会搜 MyComp 感觉定位会比较慢

    emm 感觉自己的项目还是会选择上面一种,要是别人的项目为了统一还是根据别人写法来

    4 replies  •  2022-10-11 23:10:03 +08:00
    Felix442
    Felix442
    Aug 18, 2022❤️1
    1
    组件:MyComp
    数据:myComp
    lingxiaoli
    lingxiaoli
    Aug 18, 2022
    2
    同 1 楼
    wu67
    wu67
    Aug 22, 2022
    3
    同 1. 因为在 devtool 里面看到组件名的也是大驼峰.
    这个其实还好, 项目文件名才烦, 大小驼峰、蛇形、连字符 这 4 种都有可能出现...
    gausszhou
    gausszhou
    Oct 11, 2022
    4
    组件就是类
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2321 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 13:27 · PVG 21:27 · LAX 05:27 · JFK 08:27
    ♥ Do have faith in what you're doing.