Vant introduces Dialog component to report error
1. The introduced dialog, registers the component, but prompts that it is not registered
2. Some of the codes are as follows
html
<van-dialog
v-model="show"
title=""
confirm-button-text="">
<van-row>:{{channel.goodsName}}</van-row>
<van-row>:{{channel.stock}} / {{ channel.maxStock}}</van-row>
</van-dialog>
import { Dialog, Button, Row, Col } from "vant" JS
export default {
components: {
[Dialog.name]: Dialog,
[Button.name]: Button,
[Row.name]: Row,
[Col.name]: Col
},
<template>
<div>
<van-dialog v-model="isShow">
<van-field v-model="verifyCode" label\="" placeholder\=""/>
</van-dialog>
</div>
</template>
<script>
import {Dialog, Field} from 'vant'
import 'vant/lib/index.css'
export default {
name: "Register",
components: {
"van-dialog": Dialog.Component, //
"van-field": Field //Component
},
...
</script>
, and I have a question
when you register, you should write
like this.
vanDialog: Dialog
import { Dialog, Button, Row, Col } from 'vant' JS
export default {
components: {
"van-dialog": Dialog,
"van-button": Button,
"van-row": Row,
"van-col": Col
},
well, the official recommendation itself is referenced globally in main.js. You can this.$dialog (). When you use it. Similar to this are Toast and so on
<van-field v-show="dialogShow" v-model="twoFactor" clearable placeholder="6 digits"/>
</van-dialog>
import { PullRefresh, Field, CellGroup, Cell, Button, ActionSheet, Dialog } from 'vant'
import sha256 from 'js-sha256'
import md5 from' md5'
export default {
name: 'login',
components: {
[PullRefresh.name]: PullRefresh,
[Field.name]: Field,
[CellGroup.name]: CellGroup,
[Cell.name]: Cell,
[Button.name]: Button,
[ActionSheet.name]: ActionSheet,
[Dialog.name]: Dialog
},
;