forked from verdnatura/salix-front
class components to composite API
This commit is contained in:
parent
1d9bfacaf3
commit
e89e325cad
|
@ -7,7 +7,7 @@ const routes: Array<RouteRecordRaw> = [
|
||||||
name: 'Login',
|
name: 'Login',
|
||||||
component: () => import('../views/Login/Login.vue'),
|
component: () => import('../views/Login/Login.vue'),
|
||||||
},
|
},
|
||||||
/* {
|
{
|
||||||
path: '/',
|
path: '/',
|
||||||
name: 'Main',
|
name: 'Main',
|
||||||
component: () => import('../views/Layout/Main.vue'),
|
component: () => import('../views/Layout/Main.vue'),
|
||||||
|
@ -29,7 +29,7 @@ const routes: Array<RouteRecordRaw> = [
|
||||||
component: () => import('../views/Layout/NotFound.vue'),
|
component: () => import('../views/Layout/NotFound.vue'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}, */
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
|
|
|
@ -4,11 +4,4 @@
|
||||||
</q-page>
|
</q-page>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
|
||||||
import { Options, Vue } from 'vue-class-component';
|
|
||||||
|
|
||||||
@Options({})
|
|
||||||
export default class Customer extends Vue {}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped></style>
|
||||||
|
|
|
@ -4,11 +4,4 @@
|
||||||
</q-page>
|
</q-page>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
|
||||||
import { Options, Vue } from 'vue-class-component';
|
|
||||||
|
|
||||||
@Options({})
|
|
||||||
export default class Dashboard extends Vue {}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped></style>
|
||||||
|
|
|
@ -59,22 +59,14 @@
|
||||||
</q-layout>
|
</q-layout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts" setup>
|
||||||
import { Options, Vue } from 'vue-class-component';
|
import { ref } from 'vue';
|
||||||
import Topbar from '@/components/Topbar.vue';
|
import Topbar from '@/components/Topbar.vue';
|
||||||
|
const drawer = ref(false);
|
||||||
|
const miniState = ref(true);
|
||||||
|
|
||||||
@Options({
|
function onToggleDrawer(): void {
|
||||||
components: {
|
drawer.value = !drawer.value;
|
||||||
Topbar,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
export default class Main extends Vue {
|
|
||||||
drawer = false;
|
|
||||||
miniState = true;
|
|
||||||
|
|
||||||
onToggleDrawer(): void {
|
|
||||||
this.drawer = !this.drawer;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,4 @@
|
||||||
<q-page> Page not found </q-page>
|
<q-page> Page not found </q-page>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
|
||||||
import { Options, Vue } from 'vue-class-component';
|
|
||||||
|
|
||||||
@Options({})
|
|
||||||
export default class NotFound extends Vue {}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped></style>
|
||||||
|
|
|
@ -62,12 +62,6 @@ import { useI18n } from 'vue-i18n';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
interface LoginForm {
|
|
||||||
username: string;
|
|
||||||
password: string;
|
|
||||||
keepLogin: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
@ -89,8 +83,8 @@ const darkMode = computed({
|
||||||
function onSubmit(): void {
|
function onSubmit(): void {
|
||||||
axios
|
axios
|
||||||
.post('/api/accounts/login', {
|
.post('/api/accounts/login', {
|
||||||
user: username,
|
user: username.value,
|
||||||
password: password,
|
password: password.value,
|
||||||
})
|
})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
store.dispatch('logIn', {
|
store.dispatch('logIn', {
|
||||||
|
@ -120,23 +114,6 @@ function onSubmit(): void {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/* data(): LoginForm {
|
|
||||||
return {
|
|
||||||
username: '',
|
|
||||||
password: '',
|
|
||||||
keepLogin: true,
|
|
||||||
};
|
|
||||||
} */
|
|
||||||
|
|
||||||
/* @Options({
|
|
||||||
setup() {
|
|
||||||
return {
|
|
||||||
$q: useQuasar(),
|
|
||||||
};
|
|
||||||
},
|
|
||||||
})
|
|
||||||
*/
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
Loading…
Reference in New Issue