Skip to content

docs: add a guide to annotate component type in decorator #450

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

Merged
merged 1 commit into from
Sep 14, 2020

Conversation

ktsn
Copy link
Member

@ktsn ktsn commented Sep 14, 2020

This PR adds a new docs section that describes how to annotate this type on functions in the decorator.

@Component<Post>({ // <---
  watch: {
    postId(id: string) {
      this.fetchPost(id)
    }
  }
})
class Post extends Vue {
  postId: string

  fetchPost(postId: string): Promise<void> {
    // ...
  }
}

@ktsn ktsn merged commit 7f17ca6 into master Sep 14, 2020
@ktsn ktsn deleted the decorator-type-parameter-docs branch September 14, 2020 15:50
nevilm-lt pushed a commit to nevilm-lt/vue-class-component that referenced this pull request Mar 1, 2022
nevilm-lt pushed a commit to nevilm-lt/vue-class-component that referenced this pull request Apr 22, 2022
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

Successfully merging this pull request may close these issues.

1 participant