Skip to content

Commit

Permalink
[2.7.8] Do deep equal of initialValues via lodash.isEqual on updated
Browse files Browse the repository at this point in the history
  • Loading branch information
isnifer committed Dec 11, 2018
1 parent 554c8d2 commit 7206d95
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 2.7.8

### Fixed

- Do deep equal of `initialValues` via `lodash.isEqual` on `updated`

## 2.7.7

### Fixed
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ See demo at [https://detools.github.io/vue-form](https://detools.github.io/vue-f

## Changelog

- [2.7.8](/CHANGELOG.md#278)
- [2.7.7](/CHANGELOG.md#277)
- [2.7.6](/CHANGELOG.md#276)
- [2.7.5](/CHANGELOG.md#275)
Expand Down
15 changes: 13 additions & 2 deletions VueForm/components/Form/Form.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
import { isNil, isBoolean, isEmpty, has, mapValues, union, merge, without, omit } from 'lodash'
import {
isNil,
isBoolean,
isEmpty,
isEqual,
has,
mapValues,
union,
merge,
without,
omit,
} from 'lodash'
import { Form, Button } from 'element-ui'
import CONSTANTS from '../../constants'
import { validate, asyncValidate } from '../../validators/validate'
Expand Down Expand Up @@ -44,7 +55,7 @@ export default {
},

updated() {
if (this.defaultInitialValues !== this.initialValues) {
if (!isEqual(this.defaultInitialValues, this.initialValues)) {
this.defaultInitialValues = this.initialValues
this.reinitializeValues(this.initialValues)
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@detools/vue-form",
"version": "2.7.7",
"version": "2.7.8",
"description": "Form State Management for VueJS",
"main": "VueForm/index.js",
"scripts": {
Expand Down

0 comments on commit 7206d95

Please sign in to comment.