Skip to content

Commit 0dee328

Browse files
fix(vue3): Show the imported component setup state by using exposed in production (#2091)
1 parent a1f8221 commit 0dee328

File tree

1 file changed

+8
-3
lines changed
  • packages/app-backend-vue3/src/components

1 file changed

+8
-3
lines changed

packages/app-backend-vue3/src/components/data.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,16 @@ function processState (instance) {
176176
}
177177

178178
function processSetupState (instance) {
179-
const raw = instance.devtoolsRawSetupState || {}
180-
return Object.keys(instance.setupState)
179+
const raw = instance.devtoolsRawSetupState
180+
const combinedSetupState = (Object.keys(instance.setupState).length
181+
? instance.setupState
182+
: instance.exposed
183+
) || {}
184+
185+
return Object.keys(combinedSetupState)
181186
.filter(key => !vueBuiltins.includes(key) && key.split(/(?=[A-Z])/)[0] !== 'use')
182187
.map(key => {
183-
const value = returnError(() => toRaw(instance.setupState[key]))
188+
const value = returnError(() => toRaw(combinedSetupState[key]))
184189

185190
const rawData = raw[key]
186191

0 commit comments

Comments
 (0)