diff --git a/app/src/components/SplittedMailInput.vue b/app/src/components/SplittedMailInput.vue index 18f60cb9..4629e195 100644 --- a/app/src/components/SplittedMailInput.vue +++ b/app/src/components/SplittedMailInput.vue @@ -28,13 +28,13 @@ export default { }, data () { return { - mail: this.value.split('@')[0], - domain: this.value.split('@')[1] + mail: '', + domain: '' } }, watch: { domains () { - if (this.domain === undefined) { + if (!this.domain) { this.domain = this.domains[0] } } @@ -43,6 +43,17 @@ export default { updateValue () { this.$emit('input', `${this.mail}@${this.domain}`) } + }, + created () { + if (this.value) { + const [mail, domain] = this.value.split('@') + Object.assign(this, { mail, domain }) + } else if (this.domains) { + this.domain = this.domains[0] + } + // if (this.domain === undefined) { + // this.domain = this.domains[0] + // } } } diff --git a/app/src/views/user/UserCreate.vue b/app/src/views/user/UserCreate.vue index 6b78390f..3ecd58a1 100644 --- a/app/src/views/user/UserCreate.vue +++ b/app/src/views/user/UserCreate.vue @@ -2,6 +2,7 @@
+ +