-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d15b276
commit 13afde1
Showing
11 changed files
with
73 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,21 @@ | ||
// import { decompressURLQuery } from '@uni-helper/devtools-shared' | ||
import type { InitState } from '~/types' | ||
import type { InitState } from '@uni-helper/devtools-types' | ||
|
||
export const useInitState = createGlobalState( | ||
() => { | ||
const initState = ref<InitState | object>({}) | ||
const initState = ref<InitState>() | ||
const loading = ref(false) | ||
function init() { | ||
// const params = new URLSearchParams(window.location.search) | ||
// const data = params.get('data') | ||
// if (!data) | ||
// return | ||
// initState.value = decompressURLQuery(data) | ||
// console.log('initState', initState.value) | ||
trpc.onVersion.subscribe(undefined, { | ||
onData: (data) => { | ||
initState.value!.vueVersion = data.vueVersion | ||
initState.value!.uniCompileVersion = data.uniVersion | ||
console.log('initState', initState.value) | ||
initState.value = data | ||
}, | ||
}) | ||
} | ||
|
||
return { | ||
initState, | ||
init, | ||
loading, | ||
initState, | ||
} | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
export interface ModuleInfo { | ||
id: string | ||
plugins: { name: string, transform?: number, resolveId?: number }[] | ||
deps: string[] | ||
virtual: boolean | ||
} | ||
|
||
export interface ComponentTreeNode { | ||
name: string | ||
file: string | ||
children?: ComponentTreeNode[] | ||
} | ||
|
||
/** 初始化状态 */ | ||
export interface InitState { | ||
/** 当前页面 */ | ||
currentPage: string | ||
|
||
/** uni运行版本 */ | ||
uniVersion: string | ||
|
||
/** 当前运行平台 */ | ||
uniPlatform: string | ||
|
||
/** vue版本 */ | ||
vueVersion: string | ||
|
||
/** 当前页面组件 */ | ||
components: ComponentTreeNode | ||
|
||
/** pinia数据 */ | ||
piniaState: { [key: string]: any } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "@uni-helper/devtools-types", | ||
"version": "1.0.0", | ||
"description": "", | ||
"author": "", | ||
"license": "ISC", | ||
"keywords": [], | ||
"main": "index.d.ts" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.