[autofix.ci] apply automated fixes

This commit is contained in:
autofix-ci[bot] 2024-10-24 06:24:09 +00:00 committed by GitHub
parent 8c6a92d316
commit a577158909
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 24 additions and 21 deletions

View File

@ -1,10 +1,13 @@
import {debug} from '../src/debug'
import { debug } from '../src/debug'
import {
h,
render,
type ComponentInternalInstance,
defineComponent,
ref, getCurrentInstance, ComponentInternalInstance, nodeOps,
serializeInner as inner
getCurrentInstance,
h,
serializeInner as inner,
nodeOps,
ref,
render,
} from '@vue/runtime-test'
describe('debug', () => {
@ -17,9 +20,7 @@ describe('debug', () => {
debug({
name,
})
return () => (
h('div', name.value)
)
return () => h('div', name.value)
},
mounted() {
instance = getCurrentInstance()!
@ -48,9 +49,7 @@ describe('debug', () => {
debug({
name,
})
return () => (
h('div', name.value)
)
return () => h('div', name.value)
},
mounted() {
instance = getCurrentInstance()!

View File

@ -1,5 +1,5 @@
import {reactive} from '@vue/reactivity'
import {getCurrentInstance} from './component'
import { reactive } from '@vue/reactivity'
import { getCurrentInstance } from './component'
/**
* this debug function is a helper for watching states in the vue devtool (it runs only in dev mode)
@ -16,11 +16,15 @@ import {getCurrentInstance} from './component'
* })
* @param states any states you want to see in the vue devtool
*/
export const debug = __DEV__ ? (states: Record<string, any>) => {
const instance = getCurrentInstance()
if (instance) {
instance.setupState = reactive(Object.assign({}, states, instance.setupState))
}
} : (states: Record<string, any>) => {
// empty
}
export const debug = __DEV__
? (states: Record<string, any>) => {
const instance = getCurrentInstance()
if (instance) {
instance.setupState = reactive(
Object.assign({}, states, instance.setupState),
)
}
}
: (states: Record<string, any>) => {
// empty
}