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

* docs: standardize unified example code format and fix some example type * docs: update some example type * Update docs/examples/descriptions/sizes.vue Co-authored-by: kooriookami <38392315+kooriookami@users.noreply.github.com> * docs: update example-page-header * docs: update example-page-header --------- Co-authored-by: kooriookami <38392315+kooriookami@users.noreply.github.com>
34 lines
750 B
Vue
34 lines
750 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>
|