How to Set Default Value of Props in Vue?by@smpnjn
45,612 reads

How to Set Default Value of Props in Vue?

May 15th 2022
3m
by @smpnjn 45,612 reads
tldt arrow
EN
Read on Terminal Reader
Read this story w/o Javascript

Too Long; Didn't Read

Setting default prop values in Vue is easy. If you are using the Options API, then it's as easy as extending our property into an object. In the composition API, defining props uses the defineProps function. This function follows the same syntax as props defined in the Options API.
featured image - How to Set Default Value of Props in Vue?
Johnny Simpson HackerNoon profile picture

@smpnjn

Johnny Simpson

Product, Engineering, Web


Receive Stories from @smpnjn

react to story with heart

RELATED STORIES

L O A D I N G
. . . comments & more!