Skip to content
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

type of attrs is not expected #562

Closed
popolan1986 opened this issue Oct 14, 2020 · 2 comments · Fixed by #582
Closed

type of attrs is not expected #562

popolan1986 opened this issue Oct 14, 2020 · 2 comments · Fixed by #582
Assignees
Labels
contribution welcome The team would welcome a contribution from the community for this issue

Comments

@popolan1986
Copy link
Contributor

interface Data {
  [key: string]: unknown
}

interface SetupContext {
  attrs: Data
  slots: Slots
  emit: (event: string, ...args: unknown[]) => void
}

However, the type of attrs is Record<string, string>

interface SetupContext {
    readonly attrs: Record<string, string>;
    readonly slots: {
        [key: string]: (...args: any[]) => VNode[];
    };
    readonly parent: ComponentInstance | null;
    readonly root: ComponentInstance;
    readonly listeners: {
        [key: string]: Function;
    };
    emit(event: string, ...args: any[]): void;
}
@antfu
Copy link
Member

antfu commented Oct 14, 2020

Mind create a PR?

@popolan1986
Copy link
Contributor Author

Yes, I can create a PR in this week

@LinusBorg LinusBorg assigned LinusBorg and popolan1986 and unassigned LinusBorg Oct 19, 2020
@antfu antfu added the contribution welcome The team would welcome a contribution from the community for this issue label Oct 20, 2020
@antfu antfu closed this as completed in #582 Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution welcome The team would welcome a contribution from the community for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants