I have an old project I need to update that uses 'av-ts' plugin to create class style components with vue-ts-loader to compile .ts files as vue components. The project currently runs on vue 2.4.2 but I want to update to 2.6.14. Since 'vue-ts-loader' is depricated and the project breaks after updating to ^2.5 I need an alternative way to compile the files.
I wonder if there is a way to configure the regular ts-loader to do that for me. Anyone have an idea?
Components currently look like this:
import { Component, p, Prop } from 'av-ts';
import * as Vue from 'vue';
@Component({
template: require('./example-component.component.html')
})
export default class ExampleComponent extends Vue {
@Prop public icon: any = p({
type: String,
required: false,
default: ''
});
@Prop public width: any = p({
type: Number,
required: false,
default: 24
});
@Prop public height: any = p({
type: Number,
required: false,
default: 24
});
@Prop public classes: any = p({
type: String,
required: false,
default: ''
});
}
In the worst case. We could not use SFC with ts. Due to vue-class-component is deprecated in vue3.There is a alternative one in vue3.vue-facing-decorator.It shows how to write component with regular ts file.