Compare commits
4 Commits
98cd757666
...
c63075a88d
| Author | SHA1 | Date |
|---|---|---|
|
|
c63075a88d | |
|
|
ed5c7771e8 | |
|
|
16fc36b258 | |
|
|
b803e39a5a |
|
|
@ -10,21 +10,21 @@ interface Props {
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps<Props>(); // Define props for the component
|
const props = defineProps<Props>(); // Define props for the component
|
||||||
const { value, errorMessage, ...fieldAttrs } = useField(props.name); // Setup field logic using vee-validate
|
// const { value, errorMessage, ...fieldAttrs } = useField(props.name); // Setup field logic using vee-validate
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ion-item>
|
<ion-item>
|
||||||
<Field name="name">
|
<Field name="name">
|
||||||
<IonInput
|
<!-- <IonInput-->
|
||||||
:label="label"
|
<!-- :label="label"-->
|
||||||
:label-placement="labelPlacement || 'stacked'"
|
<!-- :label-placement="labelPlacement || 'stacked'"-->
|
||||||
v-model="value"
|
<!-- v-model="value"-->
|
||||||
v-bind="fieldAttrs"
|
<!-- v-bind="fieldAttrs"-->
|
||||||
:type="type || 'text'"
|
<!-- :type="type || 'text'"-->
|
||||||
>
|
<!-- >-->
|
||||||
<small v-if="errorMessage" class="error-message">{{ errorMessage }}</small>
|
<!-- <small v-if="errorMessage" class="error-message">{{ errorMessage }}</small>-->
|
||||||
</IonInput>
|
<!-- </IonInput>-->
|
||||||
</Field>
|
</Field>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { createRouter, createWebHistory } from '@ionic/vue-router';
|
import { createRouter, createWebHistory } from '@ionic/vue-router';
|
||||||
import { useStore } from 'vuex'
|
import { useStore } from 'vuex'
|
||||||
import { RouteRecordRaw } from 'vue-router';
|
import { RouteRecordRaw } from 'vue-router';
|
||||||
import PlayerList from '../views/PlayerList.vue'
|
import PlayerListVuew from '../views/PlayerListView.vue'
|
||||||
import PlayerView from '../views/PlayerView.vue'
|
import PlayerView from '../views/PlayerView.vue'
|
||||||
import LoginView from '../views/LoginView.vue'
|
import LoginView from '../views/LoginView.vue'
|
||||||
import HomeView from '../views/HomeView.vue'
|
import HomeView from '../views/HomeView.vue'
|
||||||
|
|
@ -18,7 +18,7 @@ const routes: Array<RouteRecordRaw> = [
|
||||||
{ path: '/setup', component: SetupView },
|
{ path: '/setup', component: SetupView },
|
||||||
{ path: '/home', component: HomeView },
|
{ path: '/home', component: HomeView },
|
||||||
{ path: '/profile', component: ProfileView },
|
{ path: '/profile', component: ProfileView },
|
||||||
{ path: '/players', component: PlayerList },
|
{ path: '/players', component: PlayerListVuew },
|
||||||
{ path: '/profile/:id', component: ProfileView },
|
{ path: '/profile/:id', component: ProfileView },
|
||||||
{ path: '/bullpen', component: BullpenView },
|
{ path: '/bullpen', component: BullpenView },
|
||||||
{ path: '/stats', component: BullpenListView },
|
{ path: '/stats', component: BullpenListView },
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@ onMounted(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const submit = handleSubmit((values, { resetForm }) => {
|
const submit = handleSubmit((values, { resetForm }) => {
|
||||||
|
loginError.value = '';
|
||||||
store.dispatch('auth/login', {
|
store.dispatch('auth/login', {
|
||||||
email: values.email,
|
email: values.email,
|
||||||
password: values.password,
|
password: values.password,
|
||||||
|
|
@ -83,9 +84,9 @@ const onLogin = () => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const changeServer = () => {
|
// const changeServer = () => {
|
||||||
router.push({ path: '/setup'});
|
// router.push({ path: '/setup'});
|
||||||
}
|
// }
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -139,7 +140,7 @@ const changeServer = () => {
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-button expand="block" class="ion-margin-top" type="submit">Login</ion-button>
|
<ion-button expand="block" class="ion-margin-top" type="submit">Login</ion-button>
|
||||||
</form>
|
</form>
|
||||||
<p v-if="loginError" class="error-text">{{ loginError }}</p>
|
<p v-if="loginError" class="error-message">{{ loginError }}</p>
|
||||||
</ion-card-content>
|
</ion-card-content>
|
||||||
</ion-card>
|
</ion-card>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -63,16 +63,6 @@ ion-label strong {
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
#container {
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
top: 50%;
|
|
||||||
transform: translateY(-50%);
|
|
||||||
}
|
|
||||||
|
|
||||||
#container strong {
|
#container strong {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
line-height: 26px;
|
line-height: 26px;
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
import { mount } from '@vue/test-utils'
|
import { mount } from '@vue/test-utils'
|
||||||
import PlayerList from '../../src/views/PlayerList.vue'
|
import PlayerListVuew from '../../src/views/PlayerListView.vue'
|
||||||
import { describe, expect, test } from 'vitest'
|
import { describe, expect, test } from 'vitest'
|
||||||
|
|
||||||
describe('PlayerList.vue', () => {
|
describe('PlayerListVuew.vue', () => {
|
||||||
test('renders home vue', () => {
|
test('renders home vue', () => {
|
||||||
const wrapper = mount(PlayerList)
|
const wrapper = mount(PlayerListVuew)
|
||||||
expect(wrapper.text()).toMatch('Ready to create an app?')
|
expect(wrapper.text()).toMatch('Ready to create an app?')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue