diff --git a/.gitignore b/.gitignore index 219fb81..0d09221 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ node_modules/ npm-debug.log yarn-error.log +package-lock.json diff --git a/README.md b/README.md index 78d14c4..5bbace7 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,13 @@ export default { return { time1: '', time2: '', + shortcuts: [ + { + text: 'Today', + start: new Date(), + end: new Date() + } + ] } } } @@ -33,7 +40,7 @@ export default { ``` @@ -50,5 +57,18 @@ export default { | showYearNav | Boolean | true | Show the year nav in the calendar | | notBefore | String | '' | Disable all dates before date in YYY-MM-DD format | | notAfter | String | '' | Disable all dates after date in YYY-MM-DD format | +| shortcuts | Boolean/Array | true | the shortcuts for the range picker | + +## shortcuts +* true - show the default shortcuts +* false - hide the shortcuts +* Object[] - custom shortcuts, [{text, start, end}] + +| Prop | Type | Description | +|-----------------|---------------|------------------------| +| text | String | Text | +| start | Date | Start Date | +| end | Date | End Date | + diff --git a/datepicker/index.vue b/datepicker/index.vue index 231cf60..4f6cfda 100644 --- a/datepicker/index.vue +++ b/datepicker/index.vue @@ -29,7 +29,7 @@ :notAfter="notAfter">