WIP: account info modal prototype with a little bit of pinia state mgmt.
This commit is contained in:
@@ -3,23 +3,43 @@
|
||||
flex justify-center items-center">
|
||||
|
||||
<div class="flex">
|
||||
<ModalAccountEdit/>
|
||||
<ModalAccountEdit v-if="whichModal === MODAL_ACCT_EDIT"/>
|
||||
<ModalAccountInfo v-if="whichModal === MODAL_ACCT_INFO"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { watch, computed, } from 'vue';
|
||||
import { useModalStore } from '@/stores/modal.js';
|
||||
import ModalAccountEdit from './ModalAccountEdit.vue';
|
||||
import ModalAccountInfo from './ModalAccountInfo.vue';
|
||||
import {
|
||||
MODAL_CREATE_NEW,
|
||||
MODAL_ACCT_EDIT,
|
||||
MODAL_ACCT_INFO,
|
||||
} from "@/constants/constants.js";
|
||||
|
||||
export default {
|
||||
setup() {
|
||||
const modalStore = useModalStore();
|
||||
const whichModal = computed(() => modalStore.whichModal);
|
||||
|
||||
watch(() => whichModal, (newVal, oldVal) => {
|
||||
// (`whichModal changed from ${oldVal} to ${newVal}`);
|
||||
});
|
||||
|
||||
return {
|
||||
modalStore,
|
||||
whichModal,
|
||||
MODAL_CREATE_NEW,
|
||||
MODAL_ACCT_EDIT,
|
||||
MODAL_ACCT_INFO,
|
||||
};
|
||||
},
|
||||
components: {
|
||||
ModalAccountEdit,
|
||||
ModalAccountInfo,
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user