Skip to content
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

Readonly breaks reactive class instance #12574

Closed
johannes-z opened this issue Jun 22, 2022 · 0 comments
Closed

Readonly breaks reactive class instance #12574

johannes-z opened this issue Jun 22, 2022 · 0 comments

Comments

@johannes-z
Copy link

johannes-z commented Jun 22, 2022

Version

2.7.0-beta.5

Reproduction link

https://github.com/johannes-z/repro_vite-plugin-vue2-templates/tree/bug/vue-2.7-beta-readonly

See src/dev.ts

Steps to reproduce

git clone https://github.com/johannes-z/repro_vite-plugin-vue2-templates/
git checkout bug/vue-2.7-beta-readonly
pnpm install
pnpm run dev

What is expected?

this.data.complex.log() should log log to console.

What is actually happening?

this.data.complex.log is not a function is printed.


Passing a complex object (e.g. instance of an ES6 class) to readonly(...) breaks the prototype. If you remove readonly and only return data, it works.

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

Successfully merging a pull request may close this issue.

1 participant