Skip to content

Commit

Permalink
Merge pull request #57 from shubhadip/clear-reactivity
Browse files Browse the repository at this point in the history
fix: handling v-model clear date function reactivity
  • Loading branch information
shubhadip authored Feb 11, 2023
2 parents f1cac37 + afd0801 commit 365b249
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 11 deletions.
1 change: 0 additions & 1 deletion .eslintcache

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vuejs3-datepicker",
"version": "1.0.14",
"version": "1.0.15",
"description": "Vue 3 datepicker",
"files": [
"dist/*",
Expand Down
7 changes: 2 additions & 5 deletions src/components/datepicker/Datepicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -461,11 +461,8 @@ export default defineComponent({
selectedDate.value = date;
setPageDate(date);
emit('selected', date);
if (props.modelValue) {
emit('update:modelValue', date);
} else {
emit('input', date);
}
emit('update:modelValue', date);
emit('input', date);
}
/**
Expand Down
4 changes: 2 additions & 2 deletions src/components/examples/VModel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ export default defineComponent({
* Handler for select-day function
*/
function dateSelected(payload: Date): void {
console.log(payload);
console.log(payload, dateinput.value);
}
/**
* clear date handler
*/
function handleClearDate(): void {
console.log('clear date event triggered');
console.log('clear date event triggered', dateinput.value);
}
return {
Expand Down
3 changes: 1 addition & 2 deletions src/components/iconview/IconView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,4 @@ export default defineComponent({
},
});
</script>
<style scoped>
</style>
<style scoped></style>

0 comments on commit 365b249

Please sign in to comment.