自用vue变量命名规范
props
驼峰式命名
<PopupWindow :title-text='hello world' />
props: { titleText: String }
事件
this.$emit('close-window')
// 在父组件中
<popup-window @close-window='handleEvent()' />
组件

基础组件名

name
PascalCase命名

自用vue变量命名规范
驼峰式命名
<PopupWindow :title-text='hello world' />
props: { titleText: String }
this.$emit('close-window')
// 在父组件中
<popup-window @close-window='handleEvent()' />
PascalCase命名
本文标题:vue命名规范
本文链接:https://www.haomeiwen.com/subject/yilujhtx.html
网友评论