I am facing an issue while trying to implement this code in TypeScript within render method:
TS2339: Property 'options' does not exist on type 'ComponentOptions, DefaultMethods, DefaultComputed, PropsDefinition'
import Vue from 'vue'
declare module 'vue/types/vue' {
interface Vue {
onSwtich: Function
}
}
export default Vue.extend({
name: 'footerTabs',
data() {
return {
options: {
on: {
click: el => this.onSwtich(el)
}
}
}
},
render(h) {
return h('swiper', {
class: 'page-footer-tabs',
attrs: {
options: this.options // TS2339: Property 'options' does not exist on type 'ComponentOptions<Vue, DefaultData<Vue>, DefaultMethods<Vue>, DefaultComputed, PropsDefinition<Rec...'.
}
})
},
methods: {
onSwtich(el): void {
this.$emit('on-switch', el)
}
}
})
I have attempted to add options to
interface Vue { options: object }
However, the issue persists and the code is still not functioning correctly.