mixalbl4
mixalbl4

Reputation: 3995

vue 3 Property '...' does not exist on type

export default {
    data() {
        return {
            isLoading: false
        };
    },
    methods: {
        async showMore(parentId) {
            if (this.isLoading) return;
            this.isLoading = true;
            await this.someAction({ parentId });
            this.isLoading = false;
        }
    }
}

This code give error: Property 'isLoading' does not exist on type

Upvotes: 0

Views: 607

Answers (1)

mixalbl4
mixalbl4

Reputation: 3995

Need to use defineComponent wrapper

export default defineComponent({
    ...
});

Upvotes: 1

Related Questions