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 {
|
import {
|
||||||
h,
|
type ComponentInternalInstance,
|
||||||
render,
|
|
||||||
defineComponent,
|
defineComponent,
|
||||||
ref, getCurrentInstance, ComponentInternalInstance, nodeOps,
|
getCurrentInstance,
|
||||||
serializeInner as inner
|
h,
|
||||||
|
serializeInner as inner,
|
||||||
|
nodeOps,
|
||||||
|
ref,
|
||||||
|
render,
|
||||||
} from '@vue/runtime-test'
|
} from '@vue/runtime-test'
|
||||||
|
|
||||||
describe('debug', () => {
|
describe('debug', () => {
|
||||||
|
@ -17,9 +20,7 @@ describe('debug', () => {
|
||||||
debug({
|
debug({
|
||||||
name,
|
name,
|
||||||
})
|
})
|
||||||
return () => (
|
return () => h('div', name.value)
|
||||||
h('div', name.value)
|
|
||||||
)
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
instance = getCurrentInstance()!
|
instance = getCurrentInstance()!
|
||||||
|
@ -48,9 +49,7 @@ describe('debug', () => {
|
||||||
debug({
|
debug({
|
||||||
name,
|
name,
|
||||||
})
|
})
|
||||||
return () => (
|
return () => h('div', name.value)
|
||||||
h('div', name.value)
|
|
||||||
)
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
instance = getCurrentInstance()!
|
instance = getCurrentInstance()!
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import {reactive} from '@vue/reactivity'
|
import { reactive } from '@vue/reactivity'
|
||||||
import {getCurrentInstance} from './component'
|
import { getCurrentInstance } from './component'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* this debug function is a helper for watching states in the vue devtool (it runs only in dev mode)
|
* 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
|
* @param states any states you want to see in the vue devtool
|
||||||
*/
|
*/
|
||||||
export const debug = __DEV__ ? (states: Record<string, any>) => {
|
export const debug = __DEV__
|
||||||
const instance = getCurrentInstance()
|
? (states: Record<string, any>) => {
|
||||||
if (instance) {
|
const instance = getCurrentInstance()
|
||||||
instance.setupState = reactive(Object.assign({}, states, instance.setupState))
|
if (instance) {
|
||||||
}
|
instance.setupState = reactive(
|
||||||
} : (states: Record<string, any>) => {
|
Object.assign({}, states, instance.setupState),
|
||||||
// empty
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
: (states: Record<string, any>) => {
|
||||||
|
// empty
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue