1👍
<script setup>
//..
function dateSelected(payload) {
console.log(payload);
}
</script>
In comparison, Vue Composition API:
No need to manually cache callback functions to
avoid
unnecessary child updates. In general, Vue’s fine-grained reactivity system ensures child components only update when they need to. Manual child-update optimizations are rarely a concern for Vue developers.
0👍
In the Composition API, the concept of "void" return type for functions is not explicitly used. In JavaScript, functions don’t have an explicit return type, and you don’t need to specify it in the setup function of Vue’s Composition API.
<script setup>
import { ref } from 'vue';
const dateinput = ref(new Date());
function dateSelected(payload) {
console.log(payload);
}
</script>
In the above code, you can simply remove the : Date part from the function parameter declaration because JavaScript is dynamically typed, and the type of the payload parameter will be inferred based on its usage.
Source:stackexchange.com