按照文檔上的方式引入組件,但是還是會報錯說沒有注冊
引入方式如下:
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