<template>
<div>
<!-- <p class="text-center">hello world</p> -->
<input ref='uploadInput' type= "file" class="dl-none" name="icon" @change="dealfilechange"/>
<button class="btn btn-primary" @click="uploadgogo">
<slot name="default" v-if="status==='ready'">
<span>上传</span>
</slot>
<span v-if="status==='loading'">上传中</span>
<span v-if="status==='success'">上传成功</span>
<span v-if="status==='error'">上传失败</span>
</button>
</div>
</template>
file
<script lang="ts"
vue 上传四种状态处理
最新推荐文章于 2024-05-28 15:42:48 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)