Skip to content

Using component decorator with other components not extending Vue, causes error #171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
d1820 opened this issue Oct 23, 2017 · 1 comment

Comments

@d1820
Copy link

d1820 commented Oct 23, 2017

I am trying to add a 3rd party component to the components object of the @component decorator, because the 3rd party vue object does not extend from Vue (its a plan es5 component) I get a typescript error.

3rd party lib: https://github.com/Justineo/vue-awesome

Component

import Vue from 'vue';
import { Component } from 'vue-property-decorator';
import { IAuthService } from 'interfaces';
import { lazyInject } from '../../kernel';
import { INJECTION_TYPES } from '../../injection-types';
import Icon from 'vue-awesome/components/Icon.vue';
import 'vue-awesome/icons/eye';

@Component({
    components: {
        MenuComponent: require('../navmenu/navmenu.vue'),
        Icon
    }
})
export default class AppComponent extends Vue {
    @lazyInject(INJECTION_TYPES.AuthService)
    private _authService: IAuthService;

    signin() {
        this._authService.signIn();
    }
}

pasted image at 2017_10_23 01_47 pm

Any recommendations on how to get past this issue? Otherwise seems like a common problem that most 3rd party component developers are only coding to es5 standards.

Thanks

@ktsn
Copy link
Member

ktsn commented Oct 24, 2017

This is due to invalid type declaration for SFC.
See: #123 (comment)

@ktsn ktsn closed this as completed Oct 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants