vant中dialog的使用

按照文档上的方式引入组件,但是还是会报错说没有注册

引入方式如下:

import { Cell, CellGroup, Field, Dialog } from 'vant';

components: {
        [CellGroup.name]: CellGroup,
        [Field.name]: Field,
        [Cell.name]: Cell,
        [Dialog.name]: Dialog,
        NavBar
},
 <van-dialog> - did you register the component correctly? For recursive components, make sure to provide the "name" option

如上面展示的一样的报错,解决方式是

[Dialog.Component.name]: Dialog.Component,

加上Component

posted @ 2021-01-05 15:34  上官兰雨  阅读(4721)  评论(0编辑  收藏  举报