Skip to content

UploadInput 上传文件

代码演示

基础用法

vue
<template>
    <x-upload-input v-model="file"></x-upload-input>
</template>

<script setup>
import { ref } from 'vue'

const file = ref('')
</script>

<style lang="less" scoped>
.custom {
    width: 240px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: @color-border dashed 1px;
    cursor: pointer;
    transition: all 0.15s;

    &:hover {
        border-color: @color-primary;
        color: @color-primary;
    }
}
</style>

API

参数

名称说明类型默认值
model-value(v-model)string-
text按钮内容string选择文件
loading-text上传中按钮内容string上传中
allow-clear允许清空booleantrue

事件

名称说明返回值
change内容发生改变modelValue

本文档内容版权为 XYAdmin 作者所有,保留所有权利。