feat(Form): support using uploader

This commit is contained in:
陈嘉涵
2020-02-11 10:21:49 +08:00
parent 744cbac987
commit c2cafe289e
3 changed files with 40 additions and 0 deletions

View File

@@ -2,6 +2,9 @@
import { createNamespace, addUnit, noop } from '../utils';
import { toArray, readFile, isOversize, isImageFile } from './utils';
// Mixins
import { FieldMixin } from '../mixins/field';
// Components
import Icon from '../icon';
import Image from '../image';
@@ -13,6 +16,8 @@ const [createComponent, bem] = createNamespace('uploader');
export default createComponent({
inheritAttrs: false,
mixins: [FieldMixin],
model: {
prop: 'fileList',
},
@@ -70,6 +75,11 @@ export default createComponent({
previewSizeWithUnit() {
return addUnit(this.previewSize);
},
// for form
value() {
return this.fileList;
},
},
methods: {