validators as a plugin

This commit is contained in:
les
2020-09-05 01:21:47 +02:00
parent a0c462a3f7
commit f28347a227
17 changed files with 88 additions and 160 deletions

View File

@@ -3,23 +3,20 @@
v-col(cols='12' md="6" lg="5" xl="4")
v-card
v-card-title {{settings.title}} - {{$t('common.recover_password')}}
//- nuxt-link(to='/')
//- v-img(src='/logo.png')
//- span {{settings.title}} - {{$t('common.recover_password')}}
v-card-text
div(v-if='valid')
v-text-field(type='password'
:rules="validators.password"
:rules="$validators.password"
autofocus :placeholder='$t("common.new_password")'
v-model='new_password')
div(v-else) {{$t('recover.not_valid_code')}}
v-card-actions
v-spacer
v-btn(v-if='valid' color='primary' @click='change_password') {{$t('common.send')}}
</template>
<script>
import { mapState } from 'vuex'
import { validators } from '../../plugins/helpers'
export default {
name: 'Recover',
@@ -34,7 +31,7 @@ export default {
}
},
data () {
return { new_password: '', validators }
return { new_password: '' }
},
computed: mapState(['settings']),
methods: {