Skip to content

Vue 2 with composition api and script setup computed properties are not unwrapped in template #567

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
art-kc opened this issue Mar 8, 2025 · 0 comments

Comments

@art-kc
Copy link

art-kc commented Mar 8, 2025

I tried to run tests with script setup and composition api.
Everything works except that computed properties and refs don't unwrap in a template

For example computed

const classes: ComputedRef<string> = computed( () => { return status-flag--${props.statusFlag}; });
will output in vue template as

{ "value": "status-flag--one", "effect": true }

Though if i call it from vue context

wrapper.vm.classes

It will return correct unwrapped value
status-flag--one

My dependencies are below
"@vue/test-utils": "1.3.6", "@vue/vue2-jest": "29.2.6", "jest": "29.7.0", "babel-jest": "29.7.0", "ts-jest": "29.2.5",

Has anyone experienced same issue? I've tried switching versions of dependencies but nothing helped

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant