Diving Into Vue 3 - The Setup Function
In this article, the author discusses the new setup function introduced in Vue 3 and how it differs from the Options API used in Vue 2. The setup function allows for organizing code by logical concern rather than separating script into sections by options. This leads to a new pattern called Vue 'composables', which involves grouping code by logical concern and making it reusable. The author provides an example of how to use the setup function, highlighting important facts about its usage such as timing, lack of keyword this, requirement for returning an object, and reactivity with ref or reactive functions. Props and context are also discussed as arguments that can be passed to the setup function.
Company
Deepgram
Date published
Feb. 4, 2022
Author(s)
Sandra Rodgers
Word count
1532
Language
English
Hacker News points
None found.