Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fdbd026

Browse filesBrowse files
authored
fix(customFormatter): properly accessing ref value during debugger (#12948)
1 parent 636a861 commit fdbd026
Copy full SHA for fdbd026

File tree

Expand file treeCollapse file tree

1 file changed

+7
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-2
lines changed
Open diff view settings
Collapse file

‎packages/runtime-core/src/customFormatter.ts‎

Copy file name to clipboardExpand all lines: packages/runtime-core/src/customFormatter.ts
+7-2Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import {
44
isReadonly,
55
isRef,
66
isShallow,
7+
pauseTracking,
8+
resetTracking,
79
toRaw,
810
} from '@vue/reactivity'
911
import { EMPTY_OBJ, extend, isArray, isFunction, isObject } from '@vue/shared'
@@ -34,13 +36,16 @@ export function initCustomFormatter(): void {
3436
if (obj.__isVue) {
3537
return ['div', vueStyle, `VueInstance`]
3638
} else if (isRef(obj)) {
39+
// avoid tracking during debugger accessing
40+
pauseTracking()
41+
const value = obj.value
42+
resetTracking()
3743
return [
3844
'div',
3945
{},
4046
['span', vueStyle, genRefFlag(obj)],
4147
'<',
42-
// avoid debugger accessing value affecting behavior
43-
formatValue('_value' in obj ? obj._value : obj),
48+
formatValue(value),
4449
`>`,
4550
]
4651
} else if (isReactive(obj)) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.