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