DEV Community 👩‍💻👨‍💻

Discussion on: Be prepared to migrate your Vue app to Vue 3

chenxeed profile image
Albert Mulia Shintra Author • Edited on

Ah, good concern! I missed to mention it in the article above, that the Vue Class Component is also in the discussion to be available in Vue 3. I think the issue below mentioned some breaking changes to be noted:

wormss profile image

Wow, the example given looks really weird with watchers being external. We use vue-property-decorator which would do things like

import { Component, Ref, Watcher, Vue } from 'vue-property-decorator';
import NestedComponent from './NestedComponent';
@Component({ components: { NestedComponent }})
export default class MyClass extends Vue {
  private someRef?: HTMLInputElement;
  private someData: string;
  private someComputed(): string { return window.localStorage.getItem('foobar') ?? '' }
  @Watcher('someData', { immediate: true })
  private onSomeDataChanged(newValue: string, oldValue?: string) {
    if(this.someRef) { this.someRef.focus(); }

Just hope there are no super significant changes. We have over 925 *.vue files, all of them using vue-property-decorator

Thread Thread
chenxeed profile image
Albert Mulia Shintra Author

Yeah it'll be a hassle to migrate each of your vue files. Hopefully they don't deprecate the common interfaces in the new version for Vue 3.