@@ -77,7 +77,7 @@ export default {
7777```
7878
7979## browser
80- Download vue-date-range.js from dist/ and import in your web page. Example:
80+ Download vue-date-range.min. js from dist/ and import in your web page. Example:
8181
8282```
8383...
@@ -87,21 +87,21 @@ Download vue-date-range.js from dist/ and import in your web page. Example:
8787 :show-lunar="true"
8888 :first-day-of-week="1"
8989 :disable-days-before-today="disableDaysBeforeToday"
90- :default -date="date"
90+ :sync -date="date"
9191 :lang="lang" @change="onChange"></calendar>
9292</div>
9393...
9494<div id="range" class="calendar-wrapper">
9595 <span>{{range.startDate.format('YYYY-MM-DD')}}</span>~<span>{{range.endDate.format('YYYY-MM-DD')}}</span>
96- <daterange class="calendar" :default -range="range" :lang="lang" @change="onChange"></daterange>
96+ <daterange class="calendar" :sync -range="range" :lang="lang" @change="onChange"></daterange>
9797 <button @click.stop.prevent="setRange(-7)">Last 7 days</button>
9898 <button @click.stop.prevent="setRange(-30)">Last 1 month</button>
9999</div>
100100...
101101
102102<script src="//cdn.bootcss.com/moment.js/2.17.1/moment.min.js"></script>
103103<script src="https://unpkg.com/vue/dist/vue.js"></script>
104- <script src="../dist/vue-date-range.js"></script>
104+ <script src="../dist/vue-date-range.min. js"></script>
105105<script>
106106 new Vue({
107107 el: '#calendarLunar',
@@ -155,6 +155,13 @@ Download vue-date-range.js from dist/ and import in your web page. Example:
155155</script>
156156```
157157
158+ # .sync
159+ For Vue2.3.0+, we can use [ ` .sync ` modifier] ( https://vuejs.org/v2/guide/components.html#sync-Modifier ) :
160+ ``` javascript
161+ < calendar sync- date .sync = " date" >< / calendar>
162+ < date- range sync- range .sync = " range" >< / date- range>
163+ ```
164+
158165# Props
159166## Calendar
160167* show-lunar: Show lunar or not. Default is false.
@@ -204,15 +211,23 @@ Download vue-date-range.js from dist/ and import in your web page. Example:
204211| sl-si| Slovenian|
205212| uk| Ukrainian|
206213
207- * default-date: Init the selected date. Only for Calendar.
214+ * sync-date: The default selected date. Can be used as the “two-way binding” for date (Vue 2.3.0+). e.g.:
215+ ``` html
216+ <calendar sync-date.sync =" date" ></calendar >
217+ ```
218+ * ~~ default-date: Init the selected date. Only for Calendar.~~ (use syncDate instead)
208219* range: The selected date range. e.g.:
209220
210221 ``` javascript
211222 range: {startDate: moment (), endDate: moment ().add (7 , ' days' )}
212223 ```
213224
214225## DateRange
215- This component is build on `` Calendar `` , so it has all the props of `` Calendar `` except `` default -date``
226+ This component is build on `` Calendar `` , so it has all the props of `` Calendar `` except `` sync -date``
216227Also it has its specific props:
217228
218- * defaultRange: Use to init the date range
229+ * sync-range: The default date range. Can be used as the “two-way binding” for range (Vue 2.3.0+). e.g.:
230+ ``` html
231+ <date-range sync-range.sync =" range" ></date-range >
232+ ```
233+ * ~~ defaultRange: Used to init the date range~~
0 commit comments