全局context
这个提交包含在:
父节点
e290ee7547
当前提交
377520e47d
@ -2,8 +2,8 @@
|
||||
* Use these variables when you tailor your ArkTS code. They must be of the const type.
|
||||
*/
|
||||
export const HAR_VERSION = '1.0.1';
|
||||
export const BUILD_MODE_NAME = 'release';
|
||||
export const DEBUG = false;
|
||||
export const BUILD_MODE_NAME = 'debug';
|
||||
export const DEBUG = true;
|
||||
export const TARGET_NAME = 'default';
|
||||
|
||||
/**
|
||||
|
||||
@ -43,3 +43,7 @@ export { WindowHelper } from './src/main/ets/utils/WindowHelper'
|
||||
* 自定义view
|
||||
*/
|
||||
export { LoadingView } from './src/main/ets/view/LoadingView'
|
||||
/**
|
||||
* 自定义view
|
||||
*/
|
||||
export { GlobalContext } from './src/main/ets/ContextConfig'
|
||||
|
||||
20
src/main/ets/ContextConfig.ets
普通文件
20
src/main/ets/ContextConfig.ets
普通文件
@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright (c) Huawei Technologies Co., Ltd. 2024-2024. All rights reserved.
|
||||
*/
|
||||
|
||||
import type common from '@ohos.app.ability.common';
|
||||
|
||||
declare namespace globalThis {
|
||||
let _brushEngineContext: common.UIAbilityContext;
|
||||
};
|
||||
|
||||
export class GlobalContext {
|
||||
static getContext(): common.UIAbilityContext {
|
||||
return globalThis._brushEngineContext;
|
||||
}
|
||||
|
||||
static setContext(context: common.UIAbilityContext): void {
|
||||
globalThis._brushEngineContext = context;
|
||||
}
|
||||
}
|
||||
|
||||
正在加载...
在新工单中引用
屏蔽一个用户