feat: unwrap refs in toDisplayString
This commit is contained in:
@@ -12,8 +12,11 @@ export const toDisplayString = (val: unknown): string => {
|
||||
: String(val)
|
||||
}
|
||||
|
||||
const replacer = (_key: string, val: any) => {
|
||||
if (isMap(val)) {
|
||||
const replacer = (_key: string, val: any): any => {
|
||||
// can't use isRef here since @vue/shared has no deps
|
||||
if (val && val.__v_isRef) {
|
||||
return replacer(_key, val.value)
|
||||
} else if (isMap(val)) {
|
||||
return {
|
||||
[`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val]) => {
|
||||
;(entries as any)[`${key} =>`] = val
|
||||
|
||||
Reference in New Issue
Block a user