Skip to content

Commit

Permalink
refactor(x): UniAppImpl 代码优化
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenyuWang committed Dec 31, 2024
1 parent 2186028 commit 923bec5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/uni-app-plus/src/x/framework/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ import type {
NavigateToOptions,
SwitchTabOptions,
} from '@dcloudio/uni-app-x/types/uni'
import type { UniApp } from '@dcloudio/uni-app-x/types/app'

let appCtx: ComponentPublicInstance
const defaultApp = {
globalData: {},
}
// @ts-expect-error
class UniAppImpl implements UniApp {
get vm() {
return appCtx
Expand Down
3 changes: 1 addition & 2 deletions packages/uni-h5/src/framework/setup/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ import {
initView,
} from '@dcloudio/uni-core'
import { getCurrentBasePages } from './page'
import type { UniApp } from '@dcloudio/uni-app-x/types/app'

let appVm: ComponentPublicInstance
// @ts-expect-error
let $uniApp: UniApp
if (__X__) {
// @ts-expect-error
class UniAppImpl implements UniApp {
get vm() {
return appVm
Expand Down

0 comments on commit 923bec5

Please sign in to comment.