index.ts 848 Bytes
import { store } from "@/store/index.uts";
import { applyScreenOrientationLock } from "@/utils/apply-orientation-lock.uts";
import { updateOrientation  } from '@/services/adapter/hooks/index.uts'
export function appMixin(app: VueApp) {
	// 注入 $store,兼容旧项目 this.$store 用法
	app.config.globalProperties.$store = store;

	app.mixin({
		onPageScroll(e) {
			// scroller.emit(e.scrollTop);
		},
		onShow() {
			// 每个页面显示时统一按设备锁定方向(pad 横屏、手机竖屏),无需各页面或 LayoutRoot 单独写
			//applyScreenOrientationLock();
		},
		onLoad() {},
        onResize() {
            // 全局监听屏幕旋转,自动更新方向信息
            // 所有页面都会自动执行,无需在每个页面重复编写
            updateOrientation();
		}
	});
}

// export * from "./utils";