add UploadField

This commit is contained in:
Eric
2020-05-19 18:52:59 +08:00
parent 0d81bc7459
commit 429378fd67
2 changed files with 36 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
<template>
<el-upload
v-bind="$attrs"
@input="onInput"
v-on="$listeners"
>
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload>
</template>
<script>
export default {
props: {
value: {
type: String,
default: () => ''
}
},
watch: {
value(value) {
this.$emit('customEvent', value, 'message')
}
},
methods: {
onInput(val) {
this.$emit('input', 'my-input: ' + val)
}
}
}
</script>
<style scoped>
</style>

View File

@@ -20,3 +20,4 @@ export { default as IBox } from './IBox'
export { default as QuickActions } from './QuickActions'
export { default as Switcher } from './Swicher'
export { default as SummaryCard } from './SummaryCard'
export { default as UploadField } from './UploadField'