建议设置一下 eslint-plugn-vue插件的语法规则:

"vue/attribute-hyphenation": "error"(强制属性断字

属性官方文档:https://vuejs.github.io/eslint-plugin-vue/rules/attribute-hyphenation.html

因为在vue中,属性字母中只要含有大写字母(我们常用的驼峰写法),都无法传递成功!所以为了避免这种情况,在vue的组件属性中,禁止使用大写字母!尼玛,这个细节如果你不知道,可能会找死你大半天未必能搞定!!!

       //遇到大写字母,强制用-符号链接!
      "vue/attribute-hyphenation": "error"

Logo

前往低代码交流专区

更多推荐