mirror of
https://github.com/element-plus/element-plus.git
synced 2025-08-14 10:00:58 +08:00

* perf: change to import-x * feat: add rules * chore: fix rule * chore: fix * chore: fix * chore: fix * style: `pnpm lint:fix` * Revert "style: `pnpm lint:fix`" This reverts commit db0116a288299c507e3cfc4d7a22e2207265d920. * Revert "chore: fix" This reverts commit 69c82a90c01525e38180be4c21e8ef5602512318. * chore: fix * style: `pnpm lint:fix` * fix: lint * chore: `pnpm format`
35 lines
751 B
Vue
35 lines
751 B
Vue
<template>
|
|
<el-upload
|
|
ref="uploadRef"
|
|
class="upload-demo"
|
|
action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15"
|
|
:auto-upload="false"
|
|
>
|
|
<template #trigger>
|
|
<el-button type="primary">select file</el-button>
|
|
</template>
|
|
|
|
<el-button class="ml-3" type="success" @click="submitUpload">
|
|
upload to server
|
|
</el-button>
|
|
|
|
<template #tip>
|
|
<div class="el-upload__tip">
|
|
jpg/png files with a size less than 500kb
|
|
</div>
|
|
</template>
|
|
</el-upload>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { ref } from 'vue'
|
|
|
|
import type { UploadInstance } from 'element-plus'
|
|
|
|
const uploadRef = ref<UploadInstance>()
|
|
|
|
const submitUpload = () => {
|
|
uploadRef.value!.submit()
|
|
}
|
|
</script>
|