mirror of
https://github.com/vitest-dev/vitest.git
synced 2025-12-08 18:26:03 +00:00
26 lines
628 B
TypeScript
26 lines
628 B
TypeScript
import { toRef, useUrlSearchParams } from '@vueuse/core'
|
|
|
|
export interface Params {
|
|
file: string
|
|
view: null | 'graph' | 'editor' | 'console'
|
|
line: null | number
|
|
test: null | string
|
|
column: null | number
|
|
}
|
|
|
|
export const params = useUrlSearchParams<Params>('hash', {
|
|
initialValue: {
|
|
file: '',
|
|
view: null,
|
|
line: null,
|
|
test: null,
|
|
column: null,
|
|
},
|
|
})
|
|
|
|
export const activeFileId = toRef(params, 'file')
|
|
export const viewMode = toRef(params, 'view')
|
|
export const lineNumber = toRef(params, 'line')
|
|
export const columnNumber = toRef(params, 'column')
|
|
export const selectedTest = toRef(params, 'test')
|