Play with callbacks

This commit is contained in:
Wolfgang Huß 2021-01-28 13:51:26 +01:00
parent e062cbaa0c
commit 2068dd507b
3 changed files with 41 additions and 43 deletions

View File

@ -1,19 +1,7 @@
<template>
<div class="Slider">
<!-- <h2 class="subTitle">{{ $t('login.login') + ' XXX' }}</h2> -->
<div
v-for="sliderName in sliders"
:key="sliderName"
:class="[
'Slider__component',
activeSliderName === sliderName && '--visible',
activeSliderName !== sliderName && '--hidden',
]"
:data-test="sliderName + '-component'"
@validation="validation(sliderName)"
>
<slot :name="sliderName" />
</div>
<slot :name="activeSliderName" />
<base-button
style="float: right"
icon="check"
@ -52,10 +40,6 @@ export default {
// },
},
methods: {
validation(sliderName) {
console.log('validation !!!')
disabled = false
},
nextComponent() {
if (this.sliderIndex < this.sliders.length - 1) {
this.sliderIndex++
@ -71,17 +55,17 @@ export default {
// cursor: pointer;
// }
.Slider {
&__component {
// Wolle &:hover {
// border-bottom: 2px solid #c9c6ce;
// }
// .Slider {
// &__component {
// // Wolle &:hover {
// // border-bottom: 2px solid #c9c6ce;
// // }
// Wolle &.--visible {
// }
&.--hidden {
display: none;
}
}
}
// // Wolle &.--visible {
// // }
// // &.--hidden {
// // display: none;
// // }
// }
// }
</style>

View File

@ -28,7 +28,9 @@
export default {
name: 'RegistrationItemEnterInvite',
props: {
validateCallback: { type: Function, required: true },
email: { type: String, required: true },
// test: { type: Boolean, required: true },
},
data() {
return {
@ -49,7 +51,11 @@ export default {
},
methods: {
async handleInput() {
this.disabled = true
// Wolle this.disabled = true
console.log('handleInput !!!')
console.log('email: ', this.email)
// console.log('test: ', this.test)
this.validateCallback(false)
},
async handleInputValid() {
console.log('handleInputValid !!!')
@ -57,7 +63,8 @@ export default {
const { nonce } = this.formData
const email = this.email
// Wolle this.$emit('nonceEntered', { email, nonce })
this.$emit('validation', { email, nonce })
// this.$emit('validation', { email, nonce })
this.validateCallback(true, { email, nonce })
},
handleSubmitVerify() {
// const { nonce } = this.formData

View File

@ -7,16 +7,24 @@
</a>
</template>
<h1 class="title">{{ $t('components.registration.signup.title', metadata) }}</h1>
<component-slider :sliders="sliders">
<component-slider :sliders="sliders" :submitCallback="submit">
<!-- <template #enter-nonce slot="{test}"> -->
<template #enter-nonce>
<registration-item-enter-invite email="user@example.org">
<registration-item-enter-invite
:email="'user@example.org'"
:validateCallback="validation"
>
<ds-space margin-bottom="xxx-small" margin-top="large" centered>
<nuxt-link to="/login">{{ $t('site.back-to-login') }}</nuxt-link>
</ds-space>
</registration-item-enter-invite>
</template>
<template #create-user-account>
<registration-item-create-user-account nonce="AAAAAA" email="user@example.org" />
<registration-item-create-user-account
nonce="AAAAAA"
email="user@example.org"
:validateCallback="validation"
/>
</template>
</component-slider>
<template #topMenu>
@ -60,16 +68,15 @@ export default {
// },
},
methods: {
// Wolle clear() {
// this.unprocessedSearchInput = ''
// this.previousSearchTerm = ''
// this.searchValue = ''
// this.$emit('clearSearch')
// clearTimeout(this.searchProcess)
// },
validation(is, data = null) {
console.log('validation: ', is, data)
// this.disabled = !is
},
submit() {
console.log('submit !!!')
},
},
}
</script>
<style lang="scss">
</style>
<style lang="scss"></style>