feat: check on startup, prompt before applying update
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
title="客户"
|
||||
>
|
||||
<template #right>
|
||||
<app-update-button />
|
||||
<navbar-notify-button />
|
||||
</template>
|
||||
</t-navbar>
|
||||
@@ -31,6 +32,7 @@
|
||||
<store-overview ref="storeOverviewRef" compact />
|
||||
</template>
|
||||
<template #right-actions>
|
||||
<app-update-button />
|
||||
<navbar-notify-button />
|
||||
</template>
|
||||
<template #right>
|
||||
@@ -53,6 +55,7 @@ import { useLayout } from "timi-tdesign-mobile";
|
||||
import PendingNoticeBar from "./component/PendingNoticeBar.vue";
|
||||
import CustomerEntryPanel from "./component/CustomerEntryPanel.vue";
|
||||
import NavbarNotifyButton from "./component/NavbarNotifyButton.vue";
|
||||
import AppUpdateButton from "./component/AppUpdateButton.vue";
|
||||
import StoreOverview from "./component/StoreOverview.vue";
|
||||
import TabSplitView from "./component/TabSplitView.vue";
|
||||
import { permissionCodes } from "@/utils/permission";
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<template>
|
||||
<t-button
|
||||
v-if="visible"
|
||||
aria-label="有新版本"
|
||||
@click="router.push('/management/settings')"
|
||||
theme="default"
|
||||
shape="square"
|
||||
variant="text"
|
||||
size="small"
|
||||
>
|
||||
<t-badge dot :offset="[-4, 4]">
|
||||
<t-icon name="download" size="1.25rem" />
|
||||
</t-badge>
|
||||
</t-button>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useAppUpdate } from "@/composables/useAppUpdate";
|
||||
|
||||
defineOptions({
|
||||
name: "AppUpdateButton"
|
||||
});
|
||||
|
||||
const router = useRouter();
|
||||
const { supported, latest, autoUpdate, hasUpdate } = useAppUpdate();
|
||||
|
||||
// 只在有更新且未开启自动更新时出现,开启自动更新后由启动弹窗负责提醒
|
||||
const visible = computed(() => {
|
||||
void latest.value;
|
||||
return supported && hasUpdate() && !autoUpdate.value;
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user