feat: 添加路由守卫,优化路由管理并清理钱包卡片组件逻辑
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
<script lang='ts' setup>
|
||||
import { onIonViewDidEnter, onIonViewWillEnter } from "@ionic/vue";
|
||||
import { client } from "@/api";
|
||||
import RechargeChannel from "./recharge-channel.vue";
|
||||
|
||||
const { t } = useI18n();
|
||||
@@ -8,28 +6,12 @@ const router = useRouter();
|
||||
const { state } = useWalletStore();
|
||||
const rechargeInstance = ref<ModalInstance>();
|
||||
|
||||
async function init() {
|
||||
const { data } = await client.api.asset.balances.get();
|
||||
state.balances = data;
|
||||
}
|
||||
function onCloseModal() {
|
||||
rechargeInstance.value?.$el.dismiss(null, "confirm");
|
||||
}
|
||||
function handleWithdraw() {
|
||||
router.push("/withdraw/index");
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
init();
|
||||
});
|
||||
|
||||
onIonViewWillEnter(() => {
|
||||
init();
|
||||
});
|
||||
|
||||
onIonViewDidEnter(() => {
|
||||
init();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user