Skip to content

If i used class A extends class B, when refresh page, class A will lose methods in class B #2596

Closed Answered by posva
ganker-vito asked this question in Help and Questions
Discussion options

You must be logged in to vote

You need to add a custom serialization mechanism for classes to work with SSR (or local storage if that's what you are using). I need to add a cookbook entry page in the docs based on one of my lessons in Mastering Pinia but it sums up to using payload plugins in nuxt or https://github.com/Rich-Harris/devalue to serialize/revive classes

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ganker-vito
Comment options

Answer selected by posva
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants