File tree 3 files changed +16
-0
lines changed 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -240,6 +240,10 @@ function replacerForInternal (key) {
240
240
return `[native VNode <${ val . tag } >]`
241
241
} else if ( typeof HTMLElement !== 'undefined' && val instanceof HTMLElement ) {
242
242
return encodeCache . cache ( val , ( ) => getCustomHTMLElementDetails ( val ) )
243
+ } else if ( val . constructor ?. name === 'Store' && val . _wrappedGetters ) {
244
+ return `[object Store]`
245
+ } else if ( val . currentRoute ) {
246
+ return `[object Router]`
243
247
}
244
248
const customDetails = getCustomObjectDetails ( val , proto )
245
249
if ( customDetails != null ) return customDetails
Original file line number Diff line number Diff line change 1
1
<script setup>
2
2
import Child from ' ./Child.vue'
3
3
import { ref , computed , reactive } from ' vue'
4
+ import { useStore } from ' vuex'
5
+ import { useRouter } from ' vue-router'
4
6
5
7
const myObj = reactive ({
6
8
foo: ' bar' ,
@@ -19,6 +21,13 @@ const state2 = reactive({
19
21
function onClick () {
20
22
count .value ++
21
23
}
24
+
25
+ const throws = computed (() => { throw new Error (' oops' ) })
26
+
27
+ const store = useStore ()
28
+ const throwsWithVuex = computed (() => store .getters .throws )
29
+
30
+ const router = useRouter ()
22
31
</script >
23
32
24
33
<template >
Original file line number Diff line number Diff line change @@ -9,6 +9,9 @@ const store = createStore({
9
9
} ,
10
10
getters : {
11
11
answer : ( state ) => state . answer ,
12
+ throws : ( ) => {
13
+ throw new Error ( 'getter error' )
14
+ } ,
12
15
} ,
13
16
mutations : {
14
17
increment ( state ) {
You can’t perform that action at this time.
0 commit comments