今天在开发项目的时候遇到ant-design-vue版本1.7.8报错did you register the component correctly? For recursive components, make sure to provide the “name” option.
他的意思大概是:说组件没有注册
1.引入组件
import AutoComplete from 'ant-design-vue/es/auto-complete'
export default {
components: { AutoComplete },
}
2.使用组件
<auto-complete
v-model="nickname"
:maxLength="20"
style="width: 200px"
option-label-prop="title"
placeholder="请输入昵称"
@select="onSelect"
@search="onSearch"
@change="onChange"
@blur="handlerBlur"
@keyup.enter.native="usageData"
>
<template slot="dataSource">
<a-select-option v-for="item in options" :key="item.id" :title="item.username">
<span>{{ item.username }}</span>
<span class="ml-16 fs-14" style="color: #A0A2AA;">{{ item.org_name }}</span>
</a-select-option>
</template>
</auto-complete>