<template> <van-uploader :max-size="5 * 1024 * 1024" :after-read="afterRead" max-count="1" class="id-card-scan"> <doc-icon type="doc-scan" class="shrink-0 mr-3" style="color: var(--van-primary-color)"/> </van-uploader> </template> <script> import { showNotify } from 'vant' export default { name: 'IdCardScan', emits: ['change'], methods: { // 证件上传后 afterRead(file) { console.log(file) showNotify({ type: 'primary', message: '文件上传' }) this.$emit('change', file) } } } </script> <style lang="less" scoped> </style>