You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.1 KiB

<script setup>
import {
onLaunch,
onShow,
onHide,
onError,
onPageNotFound,
} from "@dcloudio/uni-app";
import {
checkForUpdate
} from "@/utils";
onLaunch(() => {
console.log("App Launch");
// #ifdef MP-WEIXIN
checkForUpdate();
// #endif
// #ifdef H5
if (navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1) {
// 动态添加样式处理重复标题问题
const style = document.createElement('style')
style.textContent = `
uni-page-head {
display:none !important;
}
`
document.head.appendChild(style)
}
// #endif
});
onShow(() => {
console.log("App Show");
});
onHide(() => {
console.log("App Hide");
});
onError((error) => {
console.error("App Error", error);
});
onPageNotFound((res) => {
console.error("PageNotFound", res);
uni.redirectTo({
url: "/pages/404/404",
});
});
</script>
<style lang="scss">
/* 每个页面公共css */
page {
height: 100%;
}
/* uv-ui基础样式 */
@import "@/uni_modules/uv-ui-tools/index.scss";
</style>