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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM