setup accounts
This commit is contained in:
parent
e8e8555c2f
commit
467b0eebe9
@ -5,7 +5,7 @@ import API from "../../services/imapAPI";
|
|||||||
import Input from "../basic/Input.vue";
|
import Input from "../basic/Input.vue";
|
||||||
import Button from "../basic/Button.vue";
|
import Button from "../basic/Button.vue";
|
||||||
|
|
||||||
const modal = ref(true);
|
const modal = ref(false);
|
||||||
|
|
||||||
const email = ref("");
|
const email = ref("");
|
||||||
const pwd = ref("");
|
const pwd = ref("");
|
||||||
@ -128,7 +128,7 @@ function mailChange() {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<Button :onClick="(modal = true)" text="Add Account" />
|
<Button :onClick="() => (modal = true)" text="Add Account" />
|
||||||
<Modal v-if="modal" title="Add new account" @close-modal="modal = false">
|
<Modal v-if="modal" title="Add new account" @close-modal="modal = false">
|
||||||
<template v-slot:body>
|
<template v-slot:body>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
|
@ -1,3 +1,18 @@
|
|||||||
|
<script setup>
|
||||||
|
import Account from "./Account";
|
||||||
|
import AddAccountModal from "@/components/modals/AddAccountModal";
|
||||||
|
import store from "@/store/store";
|
||||||
|
import ConfirmationModal from "@/components/modals/ConfirmationModal.vue";
|
||||||
|
import { onMounted } from "vue";
|
||||||
|
import { computed } from "@vue/reactivity";
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
store.dispatch("fetchAccounts");
|
||||||
|
});
|
||||||
|
|
||||||
|
const accounts = computed(() => store.state.accounts);
|
||||||
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div id="main">
|
<div id="main">
|
||||||
<div id="userMenu">
|
<div id="userMenu">
|
||||||
@ -6,32 +21,11 @@
|
|||||||
<span class="divider"></span>
|
<span class="divider"></span>
|
||||||
<Account v-for="(account, index) in accounts" :key="index" :data="account" />
|
<Account v-for="(account, index) in accounts" :key="index" :data="account" />
|
||||||
<span class="divider"></span>
|
<span class="divider"></span>
|
||||||
|
<ConfirmationModal />
|
||||||
<AddAccountModal />
|
<AddAccountModal />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
|
||||||
import { mapState } from "vuex";
|
|
||||||
import Account from "./Account";
|
|
||||||
import AddAccountModal from "@/components/modals/AddAccountModal";
|
|
||||||
import store from "@/store/store";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: "Accounts",
|
|
||||||
components: {
|
|
||||||
Account,
|
|
||||||
AddAccountModal,
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState(["accounts"]),
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
store.dispatch("fetchAccounts");
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
#main {
|
#main {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
Loading…
Reference in New Issue
Block a user