re: Be prepared to migrate your Vue app to Vue 3 VIEW POST

re: 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 t...

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

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.

code of conduct - report abuse