refactor(dev): 将 $__DEV__ 重命名为 __DEV__

This commit is contained in:
严浩
2025-08-14 14:31:19 +08:00
parent 231249b357
commit 1d4f3b601a
12 changed files with 14 additions and 14 deletions

View File

@@ -425,7 +425,7 @@ watchEffect(() => {
<template>
<!-- <pre
v-if="$__DEV__"
v-if="__DEV__"
class="fixed bottom-10 right-10 top-10 z-[9999] overflow-auto overflow-y-auto bg-white p-[10px] text-[12px] text-black"
>{{ { 选项卡菜单7个: $enum(E_选项卡菜单).getValues(), ...state } }}</pre
> -->

View File

@@ -25,7 +25,7 @@ export class HCesiumManager {
try {
this.viewer = new Cesium.Viewer(container, VIEWER_OPTIONS_FN());
if ($__DEV__) Object.assign(globalThis, { viewer: this.viewer });
if (__DEV__) Object.assign(globalThis, { viewer: this.viewer });
configureTimeLine(this.viewer);

View File

@@ -6,7 +6,7 @@ import { HCesiumManager } from './managers/HCesiumManager';
export function useHCesiumManager(containerId: string) {
const hCesiumViewerManager = ref(new HCesiumManager());
// 可以在开发模式下暴露 manager 实例,方便调试
if ($__DEV__) Object.assign(globalThis, { hCesiumViewerManager });
if (__DEV__) Object.assign(globalThis, { hCesiumViewerManager });
onMounted(() => {
hCesiumViewerManager.value.init(containerId);

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
const { isActive: isCounting, remaining: countdownTime, start: startCountdown } = useCountdown($__DEV__ ? 3 : 60);
const { isActive: isCounting, remaining: countdownTime, start: startCountdown } = useCountdown(__DEV__ ? 3 : 60);
const isSending = ref(false);
const sendSms = async () => {

View File

@@ -2,7 +2,7 @@
http://localhost:4730/Page/PinPuYi
-->
<script setup lang="ts">
definePage({ meta: { title: '频谱仪', hidden: !$__DEV__ } });
definePage({ meta: { title: '频谱仪', hidden: !__DEV__ } });
</script>
<template>

View File

@@ -45,7 +45,7 @@ export const openDialog = async () => {
});
await nextTick();
// if ($__DEV__) return;
// if (__DEV__) return;
await new Promise((resolve) => setTimeout(resolve, 300));
DialogService.open(dialogContent, {

View File

@@ -53,7 +53,7 @@ async function loadMore() {
});
const data = await response.json();
state.list = [...state.list, ...data];
if ($__DEV__) await new Promise((resolve) => setTimeout(resolve, 500));
if (__DEV__) await new Promise((resolve) => setTimeout(resolve, 500));
state.complete = state.list.length >= 5;
} catch (error) {
state.error = error;

View File

@@ -152,7 +152,7 @@ line2 += '9';
// '',
// );
// if ($__DEV__) {
// if (__DEV__) {
// const tle = TLE_LIST[0] as string;
// const line1 = tle.split('\n')[1] as string;
// const line2 = tle.split('\n')[2] as string;
@@ -160,7 +160,7 @@ line2 += '9';
// twoline2satrecFake(line1, line2);
// }
// if ($__DEV__) {
// if (__DEV__) {
// const satrec2 = twoline2satrec(
// `1 62949 25070.91668981 .00039463 00000+0 99294-3 `,
// `2 53.1596 120.9032 0001355 101.1211 35.9659 15.39574303 `,

View File

@@ -2,7 +2,7 @@ import { autoAnimatePlugin } from '@formkit/auto-animate/vue';
import { createHead } from '@unhead/vue/client';
export function install({ app }: { app: import('vue').App<Element> }) {
app.config.globalProperties.$__DEV__ = $__DEV__;
app.config.globalProperties.__DEV__ = __DEV__;
app.use(autoAnimatePlugin); // v-auto-animate="{ duration: 100 }"

View File

@@ -14,7 +14,7 @@ const router = createRouter({
strict: true,
});
if (import.meta.hot) handleHotUpdate(router);
if ($__DEV__) Object.assign(globalThis, { router });
if (__DEV__) Object.assign(globalThis, { router });
router.onError((error) => {
console.debug('🚨 [router error]:', error);
});

View File

@@ -1,9 +1,9 @@
declare global {
const $__DEV__: boolean;
const __DEV__: boolean;
}
declare module 'vue' {
export interface ComponentCustomProperties {
$__DEV__: boolean;
__DEV__: boolean;
}
}