mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-20 02:31:43 +00:00
add UploadField
This commit is contained in:
35
src/components/UploadField/index.vue
Normal file
35
src/components/UploadField/index.vue
Normal 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>
|
@@ -20,3 +20,4 @@ export { default as IBox } from './IBox'
|
|||||||
export { default as QuickActions } from './QuickActions'
|
export { default as QuickActions } from './QuickActions'
|
||||||
export { default as Switcher } from './Swicher'
|
export { default as Switcher } from './Swicher'
|
||||||
export { default as SummaryCard } from './SummaryCard'
|
export { default as SummaryCard } from './SummaryCard'
|
||||||
|
export { default as UploadField } from './UploadField'
|
||||||
|
Reference in New Issue
Block a user