1. 新建文件夹 components
文件夹名称必须是 components ,否则组件无法自动导入

2. 新建组件

3. 编辑组件
components/logo/logo.vue
html
<template>
<img src="https://img.alicdn.com/imgextra/i1/O1CN01EI93PS1xWbnJ87dXX_!!6000000006451-2-tps-150-150.png" />
</template>
4. 使用组件
因 uniapp 会自动导入 components 文件夹中的组件,所以直接在页面中使用即可
pages/index/index.vue
html
<logo></logo>
效果如下
