Working log in/route guard
This commit is contained in:
@@ -40,14 +40,14 @@
|
||||
<!-- Name on Card -->
|
||||
<div class="form-control">
|
||||
<label class="label"><span class="label-text font-bold">Name on Card</span></label>
|
||||
<input v-model="CardForm.card_name" type="text" placeholder="John M. Doe" class="input input-bordered input-sm w-full" />
|
||||
<span v-if="v$.CardForm.card_name.$error" class="text-red-500 text-xs mt-1">Required.</span>
|
||||
<input v-model="CardForm.name_on_card" type="text" placeholder="" class="input input-bordered input-sm w-full" />
|
||||
<span v-if="v$.CardForm.name_on_card.$error" class="text-red-500 text-xs mt-1">Required.</span>
|
||||
</div>
|
||||
|
||||
<!-- Card Number -->
|
||||
<div class="form-control">
|
||||
<label class="label"><span class="label-text font-bold">Card Number</span></label>
|
||||
<input v-model="CardForm.card_number" type="text" placeholder="4242..." class="input input-bordered input-sm w-full" />
|
||||
<input v-model="CardForm.card_number" type="text" placeholder="" class="input input-bordered input-sm w-full" />
|
||||
<span v-if="v$.CardForm.card_number.$error" class="text-red-500 text-xs mt-1">Required.</span>
|
||||
</div>
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<!-- Security Number (CVV) -->
|
||||
<div class="form-control">
|
||||
<label class="label"><span class="label-text font-bold">CVV</span></label>
|
||||
<input v-model="CardForm.security_number" type="text" placeholder="123" class="input input-bordered input-sm w-full" />
|
||||
<input v-model="CardForm.security_number" type="text" placeholder="" class="input input-bordered input-sm w-full" />
|
||||
<span v-if="v$.CardForm.security_number.$error" class="text-red-500 text-xs mt-1">Required.</span>
|
||||
</div>
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
<!-- Billing Zip Code -->
|
||||
<div class="form-control">
|
||||
<label class="label"><span class="label-text font-bold">Billing Zip Code</span></label>
|
||||
<input v-model="CardForm.zip_code" type="text" placeholder="01234" class="input input-bordered input-sm w-full" />
|
||||
<input v-model="CardForm.zip_code" type="text" placeholder="" class="input input-bordered input-sm w-full" />
|
||||
</div>
|
||||
|
||||
<!-- Main Card Checkbox -->
|
||||
@@ -134,7 +134,7 @@ export default defineComponent({
|
||||
customer: {} as any,
|
||||
// --- REFACTORED: Simplified, flat form object ---
|
||||
CardForm: {
|
||||
card_name: '',
|
||||
name_on_card: '',
|
||||
expiration_month: '',
|
||||
expiration_year: '',
|
||||
type_of_card: '',
|
||||
@@ -149,7 +149,7 @@ export default defineComponent({
|
||||
return {
|
||||
// --- REFACTORED: Validation points to the flat form object ---
|
||||
CardForm: {
|
||||
card_name: { required, minLength: minLength(1) },
|
||||
name_on_card: { required, minLength: minLength(1) },
|
||||
expiration_month: { required },
|
||||
expiration_year: { required },
|
||||
security_number: { required, minLength: minLength(1) },
|
||||
|
||||
Reference in New Issue
Block a user