mirror of https://github.com/vuejs/core.git
[autofix.ci] apply automated fixes
This commit is contained in:
parent
8c6a92d316
commit
a577158909
|
@ -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()!
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue