修复问题
This commit is contained in:
@@ -20,6 +20,11 @@
|
||||
</van-tabbar-item>
|
||||
</van-tabbar>
|
||||
<GlobalAddBill @success="handleAddTransactionSuccess"/>
|
||||
|
||||
<div v-if="needRefresh" class="update-toast" @click="updateServiceWorker">
|
||||
<van-icon name="upgrade" class="update-icon" />
|
||||
<span>新版本可用,点击刷新</span>
|
||||
</div>
|
||||
</div>
|
||||
</van-config-provider>
|
||||
</template>
|
||||
@@ -29,6 +34,7 @@ import { RouterView, useRoute } from 'vue-router'
|
||||
import { ref, onMounted, onUnmounted, computed, watch } from 'vue'
|
||||
import { useMessageStore } from '@/stores/message'
|
||||
import GlobalAddBill from '@/components/Global/GlobalAddBill.vue'
|
||||
import { needRefresh, updateServiceWorker } from './registerServiceWorker'
|
||||
import '@/styles/common.css'
|
||||
|
||||
const messageStore = useMessageStore()
|
||||
@@ -221,4 +227,31 @@ const subscribeToPush = async () => {
|
||||
font-size: 12px;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.update-toast {
|
||||
position: fixed;
|
||||
bottom: 80px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
background-color: var(--van-primary-color);
|
||||
color: white;
|
||||
padding: 10px 20px;
|
||||
border-radius: 24px;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
||||
z-index: 2000;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.update-toast:active {
|
||||
transform: translateX(-50%) scale(0.95);
|
||||
}
|
||||
|
||||
.update-icon {
|
||||
font-size: 18px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user