Skip to content

Instantly share code, notes, and snippets.

@viT-1
Last active November 2, 2022 20:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save viT-1/ad23f3daa9c637f165051f0a5c03cde2 to your computer and use it in GitHub Desktop.
Save viT-1/ad23f3daa9c637f165051f0a5c03cde2 to your computer and use it in GitHub Desktop.
#gist-bookmark #vue #class #oop

Что делать с синтаксисом, когда даже с вводом в Vue3 поддержки TypeScript из коробки, классы не выжили?

Вообще, это интересное развитие событий, когда в мажорную предыдущую версию (v2.7) добавляют новое API (Composition) фактически из новой мажорной версии (v3.0). Что называется "дать заднюю", когда предполагался задел на будущее из v2 в v3 в виде vue-class-decorator.

One catch was that the base Vue class for components needs to be imported from vue-class-component, not from the vue-property-decorator (as we had it before). It works in the actual app, but fails in tests (vue-test-utils)

Цитировано отсюда

Why not migrating to the composition api? because the options API is a completely direct, no-brainer migration. The team still doesn't have real/professional experience with the composition API (neither do I), so doing the mentioned above, and at the same time trying to figure our what is the best way to transform our code to correctly use / better leverage the composition API... again is not an option for us.

Цитировано отсюда. Разворачивается целый рынок, где можно заработать на миграции проектов с Vue2 на Vue3!!!

Highly recommend you migrate away from class components if you ever plan to migrate to Vue 3 because it appears the vue-class-component package has been abandoned and this package is complementary to that one so neither will likely ever be officially released.

Цитировано отсюда. То есть Class API предполагается оставить за Vue2, а Vue3 перевести на другие рельсы, несмотря на то, что TypeScript поддерживает классы.

@viT-1
Copy link
Author

viT-1 commented Nov 2, 2022

Обсуждение придания статуса deprecated проекту vue-class-component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment