Skip to content

Commit

Permalink
fix(vue3): Show the imported component setup state by using exposed i…
Browse files Browse the repository at this point in the history
…n production (#2091)
  • Loading branch information
Azurewarth0920 authored Feb 4, 2024
1 parent a1f8221 commit 0dee328
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/app-backend-vue3/src/components/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,16 @@ function processState (instance) {
}

function processSetupState (instance) {
const raw = instance.devtoolsRawSetupState || {}
return Object.keys(instance.setupState)
const raw = instance.devtoolsRawSetupState
const combinedSetupState = (Object.keys(instance.setupState).length
? instance.setupState
: instance.exposed
) || {}

return Object.keys(combinedSetupState)
.filter(key => !vueBuiltins.includes(key) && key.split(/(?=[A-Z])/)[0] !== 'use')
.map(key => {
const value = returnError(() => toRaw(instance.setupState[key]))
const value = returnError(() => toRaw(combinedSetupState[key]))

const rawData = raw[key]

Expand Down

0 comments on commit 0dee328

Please sign in to comment.