tiny-vue/examples/sites/demos/mobile/app/file-upload/custom-upload-tip.vue

26 lines
577 B
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<tiny-file-upload ref="upload" :action="action" accept=".jpg,.png">
<template #trigger>
<icon-upload></icon-upload>
</template>
<template #tip> 只能上传 jpg/png 文件且不超过500 kb </template>
</tiny-file-upload>
</template>
<script lang="jsx">
import { FileUpload } from '@opentiny/vue'
import { iconUpload } from '@opentiny/vue-icon'
export default {
components: {
TinyFileUpload: FileUpload,
IconUpload: iconUpload()
},
data() {
return {
action: 'http://localhost:3000/api/upload'
}
}
}
</script>