Skip to content

Commit a1350ad

Browse files
committed
[2.7.5] Pass <Upload /> value as file-list prop to UI component
1 parent d981aa2 commit a1350ad

File tree

6 files changed

+25
-19
lines changed

6 files changed

+25
-19
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 2.7.5
2+
3+
### Fixed
4+
5+
— Pass `<Upload />` value as `file-list` prop to UI component
6+
— Add default noop value for `handleModelChange`
7+
— Call `handleModelChange` on `reinitialize`
8+
19
## 2.7.4
210

311
### Added

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ See demo at [https://detools.github.io/vue-form](https://detools.github.io/vue-f
8080

8181
## Changelog
8282

83+
- [2.7.5](/CHANGELOG.md#275)
8384
- [2.7.4](/CHANGELOG.md#274)
8485
- [2.7.3](/CHANGELOG.md#273)
8586
- [2.7.2](/CHANGELOG.md#272)

VueForm/components/ConnectedUpload.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,11 @@ const ConnectedInput = {
8282
default: response => response,
8383
},
8484

85-
fileList: {
86-
type: Array,
87-
default: () => [],
88-
},
85+
// fileList: {
86+
// type: Array,
87+
// default: () => [],
88+
// },
89+
8990
listType: {
9091
type: String,
9192
default: 'text',
@@ -160,7 +161,7 @@ const ConnectedInput = {
160161
setValue(this.formatResponse(response, file, filelist))
161162
},
162163

163-
renderComponent() {
164+
renderComponent(value) {
164165
return (
165166
<Upload
166167
{...this.callbacks}
@@ -176,7 +177,7 @@ const ConnectedInput = {
176177
accept={this.accept}
177178
before-upload={this.beforeUpload}
178179
before-remove={this.beforeRemove}
179-
file-list={this.fileList}
180+
file-list={value}
180181
list-type={this.listType}
181182
auto-upload={this.autoUpload}
182183
http-request={this.httpRequest}

VueForm/components/Form/Form.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,7 @@ export default {
136136
vm.$delete(this.asyncErrors, name)
137137
}
138138

139-
if (this.handleModelChange) {
140-
this.handleModelChange(this.state)
141-
}
139+
this.handleModelChange(this.state)
142140

143141
setError(nextValue)
144142
}
@@ -288,6 +286,8 @@ export default {
288286
this.syncErrors = {}
289287
this.asyncErrors = {}
290288
this.touchedFields = {}
289+
290+
this.handleModelChange(this.state)
291291
},
292292

293293
renderPlainButtons() {

VueForm/components/Form/props.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ const formProps = {
3333
type: Function,
3434
default: noop,
3535
},
36-
handleModelChange: Function,
36+
handleModelChange: {
37+
type: Function,
38+
default: noop,
39+
},
3740
handleDisabled: {
3841
type: Function,
3942
default: noop,

package.json

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@detools/vue-form",
3-
"version": "2.7.4",
3+
"version": "2.7.5",
44
"description": "Form State Management for VueJS",
55
"main": "VueForm/index.js",
66
"scripts": {
@@ -15,14 +15,7 @@
1515
"type": "git",
1616
"url": "git+https://github.com/detools/vue-form.git"
1717
},
18-
"keywords": [
19-
"vue",
20-
"form",
21-
"state",
22-
"management",
23-
"validation",
24-
"errors"
25-
],
18+
"keywords": ["vue", "form", "state", "management", "validation", "errors"],
2619
"author": "Anton Kuznetsov <isnifer@gmail.com> (https://github.com/isnifer)",
2720
"license": "MIT",
2821
"bugs": {

0 commit comments

Comments
 (0)