how could I force some of my vue components to implement a method?

Viewed 45

I'm using Vue 3 with OptionsAPI and defineComponents to implement my components using typescript.

Is there any way to make some of my components extend an interface that forces them to implement mandatory methods and variables?

something like that:

interface sellerComponents {
    updateWhenSellerChanged: void
}


export default defineComponent({
    methods: {
        //error, updateWhenSellerChanged not defined
    }
})
0 Answers
Related