parent
bf7c4ad023
commit
834be04ebb
@ -0,0 +1,45 @@
|
||||
<template>
|
||||
<va-modal v-model="showModal" @ok="handleSubmit" @close="$emit('closeModal')">
|
||||
<va-form autofocus tag="form" @submit.prevent="handleSubmit" class="login-form">
|
||||
<va-input label="Username" v-model="username" class="form-item" />
|
||||
<va-input type="password" label="Password" v-model="password" class="form-item" />
|
||||
</va-form>
|
||||
</va-modal>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'login-form',
|
||||
props: {
|
||||
showModal: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
username: 'demo',
|
||||
password: 'demo',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleSubmit() {
|
||||
this.$router.push('/admin')
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="css" scoped>
|
||||
.login-form {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 30rem;
|
||||
}
|
||||
|
||||
.form-item {
|
||||
margin: 1rem auto;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,45 @@
|
||||
<template>
|
||||
<navbar />
|
||||
<va-modal v-model="showModal" :overlay="false" no-dismiss without-transitions hide-default-actions>
|
||||
<va-form autofocus tag="form" @submit.prevent="handleSubmit" class="login-form">
|
||||
<va-input label="Username" v-model="username" class="form-item" />
|
||||
<va-input type="password" label="Password" v-model="password" class="form-item" />
|
||||
<va-button type="submit" class="form-item">Login</va-button>
|
||||
</va-form>
|
||||
</va-modal>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import Navbar from '@/components/Navbar.vue';
|
||||
export default {
|
||||
name: 'login-screen',
|
||||
components: { Navbar },
|
||||
data() {
|
||||
return {
|
||||
showModal: true,
|
||||
username: 'demo',
|
||||
password: 'demo',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleSubmit() {
|
||||
this.$router.push('/admin')
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="css" scoped>
|
||||
.login-form {
|
||||
margin: auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 30rem;
|
||||
}
|
||||
|
||||
.form-item {
|
||||
margin: 1rem auto;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in new issue