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

原文地址:https://www.cnblogs.com/florazeng/p/14236132.html