42 lines
616 B
Markdown
42 lines
616 B
Markdown
# Vue 基础代码 `[Vue.Base]`
|
|
|
|
> - includes `*.vue`
|
|
|
|
## Vue 自定义组件命名规则 `[Vue.Base.CustomComponentName]`
|
|
|
|
必须使用大驼峰命名并且使用的时候也是,并且至少两个单词。
|
|
|
|
### Example: 自定义组件命名
|
|
|
|
#### Good: 使用大驼峰且至少两个单词
|
|
|
|
```vue
|
|
<!-- UserInfo.vue -->
|
|
<template>
|
|
<div></div>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: "UserInfo",
|
|
// ...
|
|
};
|
|
</script>
|
|
```
|
|
|
|
#### Bad: 使用全小写或单词不足
|
|
|
|
```vue
|
|
<!-- userinfo.vue -->
|
|
<template>
|
|
<div></div>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: "userinfo",
|
|
// ...
|
|
};
|
|
</script>
|
|
```
|