Skip to content

Commit 13e7af3

Browse files
committed
feat(v-text/v-html): Add the ability to render custom toString()
vuejs#8093
1 parent f29d338 commit 13e7af3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/shared/util.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export function isValidArrayIndex (val: any): boolean {
7777
export function toString (val: any): string {
7878
return val == null
7979
? ''
80-
: typeof val === 'object'
80+
: typeof val === 'object' && (!isPlainObject(val) || val.toString() === _toString.call(val))
8181
? JSON.stringify(val, null, 2)
8282
: String(val)
8383
}

0 commit comments

Comments
 (0)