diff --git a/src/components/HdEditSwitch.vue b/src/components/HdEditSwitch.vue index e753d7e2e..07ee8b3e7 100644 --- a/src/components/HdEditSwitch.vue +++ b/src/components/HdEditSwitch.vue @@ -116,8 +116,8 @@ export default { }; }, watch: { - editing() { - this.isEditMode = this.editing; + editing(value) { + this.isEditMode = value; }, }, computed: { diff --git a/src/components/form/HdDynamicForm.vue b/src/components/form/HdDynamicForm.vue index efebd72fd..4771b61ae 100644 --- a/src/components/form/HdDynamicForm.vue +++ b/src/components/form/HdDynamicForm.vue @@ -25,6 +25,9 @@ import HdInput from 'hd-blocks/components/form/HdInput.vue'; import HdCheckbox from 'hd-blocks/components/form/HdCheckbox.vue'; import HdRadio from 'hd-blocks/components/form/HdRadio.vue'; import HdPasswordConfirm from 'hd-blocks/components/form/HdPasswordConfirm.vue'; +import HdTextarea from 'hd-blocks/components/form/HdTextarea.vue'; +import HdSelect from 'hd-blocks/components/form/HdSelect.vue'; +import HdTagsSelector from 'hd-blocks/components/form/HdTagsSelector.vue'; export default { name: 'HdDynamicForm', @@ -101,6 +104,12 @@ export default { return HdRadio; case 'passwordConfirm': return HdPasswordConfirm; + case 'textarea': + return HdTextarea; + case 'select': + return HdSelect; + case 'tagsSelector': + return HdTagsSelector; default: return null; } diff --git a/src/components/form/HdPasswordConfirm.vue b/src/components/form/HdPasswordConfirm.vue index 3fcdb20d5..5564961ac 100644 --- a/src/components/form/HdPasswordConfirm.vue +++ b/src/components/form/HdPasswordConfirm.vue @@ -79,10 +79,11 @@ export default { }; }, watch: { - value() { - this.passwordMain = this.value; + value(value) { + this.passwordMain = value; }, - passwordMain() { + passwordMain(value) { + this.$emit('input', value); this.$nextTick(this.validate); }, passwordConfirm() { @@ -100,10 +101,6 @@ export default { }, }, methods: { - fieldDataChange() { - this.$emit('input', this.passwordMain); - this.$nextTick(this.validate); - }, validate() { const inputsAreMatching = this.checkPasswordMatching(); const passwordIsLongEnough = this.checkPasswordLength(); diff --git a/src/components/form/HdSelect.vue b/src/components/form/HdSelect.vue index 2266e3214..96f88d095 100644 --- a/src/components/form/HdSelect.vue +++ b/src/components/form/HdSelect.vue @@ -100,8 +100,8 @@ export default { }, }, watch: { - value() { - this.currentValue = this.value; + value(value) { + this.currentValue = value; }, currentValue() { this.handleChange(); diff --git a/src/components/form/HdTagsSelector.vue b/src/components/form/HdTagsSelector.vue index 74a2cbce8..d103911eb 100644 --- a/src/components/form/HdTagsSelector.vue +++ b/src/components/form/HdTagsSelector.vue @@ -71,8 +71,8 @@ export default { }, }, watch: { - value() { - this.selectedTags = this.value; + value(value) { + this.selectedTags = value; }, }, mounted() {