lifesimple
V2EX  ›  Vue.js

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

  •  
  •   lifesimple · Aug 17, 2022 · 1839 views
    This topic created in 1391 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
    sqlNice
        1
    sqlNice  
       Aug 18, 2022   ❤️ 1
    组件:MyComp
    数据:myComp
    lingxiaoli
        2
    lingxiaoli  
       Aug 18, 2022
    同 1 楼
    wu67
        3
    wu67  
       Aug 22, 2022
    同 1. 因为在 devtool 里面看到组件名的也是大驼峰.
    这个其实还好, 项目文件名才烦, 大小驼峰、蛇形、连字符 这 4 种都有可能出现...
    gausszhou
        4
    gausszhou  
       Oct 11, 2022
    组件就是类
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3018 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 14:39 · PVG 22:39 · LAX 07:39 · JFK 10:39
    ♥ Do have faith in what you're doing.