Ritu Singh
You must generate your date in the parent component—in this case, App.vue—if you wish to pass dates as props. The defineProps function merely as an interface for organizing our props and specifying their types, default values, and necessity. Both String and Date are valid prop types that I have defined in Header.vue, depending on how you want to pass your date props.
Here is how you can do it:
App.vue
Header.vue
Suggested blogs:
>How to manipulate manipulating Array object in JavaScript?
>How to do light and dark mode in a website using HTML and JavaScript?
>How to fix mouseover event glitch in JavaScript?
>How to use querySelectorAll()" with multiple conditions in JavaScript?
>Making a two-column grid overflow into the left column in Javascript
>How can I specify a monkey-patched class in the typescript definitions file in JavaScript?
>How to merge an object into Array of an objects with the same key in JavaScript?
>How to make one JavaScript event wait for another to trigger?
>How to manipulate Array object in JavaScript?
>How to do light and dark mode in a website using HTML and JavaScript?
>How to fix mouseover event glitch in JavaScript?