Browse Source

Update BaseCard component

pull/341/head
Hironsan 5 years ago
parent
commit
36297ba840
2 changed files with 27 additions and 31 deletions
  1. 27
      frontend/components/molecules/BaseCard.vue
  2. 31
      frontend/components/organisms/LoginForm.vue

27
frontend/components/molecules/BaseCard.vue

@ -1,18 +1,18 @@
<template>
<v-card>
<v-card-title class="grey lighten-2">
{{ title }}
</v-card-title>
<v-container grid-list-sm>
<v-layout wrap>
<v-flex xs12>
<slot name="content" />
</v-flex>
</v-layout>
</v-container>
<v-toolbar
color="primary white--text"
flat
>
<v-toolbar-title>{{ title }}</v-toolbar-title>
</v-toolbar>
<v-card-text class="text--primary mt-3 pl-4">
<slot name="content" />
</v-card-text>
<v-card-actions>
<v-spacer />
<v-btn
v-if="cancelText"
class="text-capitalize"
text
color="primary"
@ -22,6 +22,7 @@
{{ cancelText }}
</v-btn>
<v-btn
v-if="agreeText"
class="text-none"
text
:disabled="disabled"
@ -44,13 +45,11 @@ export default {
},
cancelText: {
type: String,
default: '',
required: true
default: ''
},
agreeText: {
type: String,
default: '',
required: true
default: ''
},
disabled: {
type: Boolean,

31
frontend/components/organisms/LoginForm.vue

@ -1,9 +1,11 @@
<template>
<v-card class="elevation-12">
<v-toolbar color="primary" dark flat>
<v-toolbar-title>Login</v-toolbar-title>
</v-toolbar>
<v-card-text>
<base-card
title="Login"
agree-text="Login"
:disabled="!valid"
@agree="tryLogin"
>
<template #content>
<v-form
ref="form"
v-model="valid"
@ -26,24 +28,19 @@
type="password"
/>
</v-form>
</v-card-text>
<v-card-actions>
<div class="flex-grow-1" />
<v-btn
:disabled="!valid"
color="primary"
@click="tryLogin"
>
Login
</v-btn>
</v-card-actions>
</v-card>
</template>
</base-card>
</template>
<script>
import { userNameRules, passwordRules } from '@/rules/index'
import BaseCard from '@/components/molecules/BaseCard'
export default {
components: {
BaseCard
},
props: {
login: {
type: Function,

Loading…
Cancel
Save