-
-
-
+
+
+
@@ -44,9 +44,9 @@ export default {
disabledDate (time) {
return time < this.min || time > this.max
},
- selectedDate (selectedRange) {
+ selectedDate (date) {
console.log('You have been selected:')
- console.log(selectedRange)
+ console.log(date)
}
}
}
diff --git a/package.json b/package.json
index 6082d02..ba777e1 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "vue-datepicker-local",
- "version": "1.0.9",
+ "version": "1.0.10",
"description": "A datepicker for Vue.js",
"main": "src/index.js",
"files": [
diff --git a/src/VueDatepickerLocal.vue b/src/VueDatepickerLocal.vue
index 711893d..0d92a14 100644
--- a/src/VueDatepickerLocal.vue
+++ b/src/VueDatepickerLocal.vue
@@ -7,14 +7,14 @@
-
-
-
-
+
+
+
+
@@ -67,7 +67,7 @@ export default {
months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'), // months of panel
weeks: '一_二_三_四_五_六_日'.split('_'), // weeks
cancelTip: '取消', // default text for cancel button
- submitTip: '提交' // default text for submit button
+ submitTip: '确定' // default text for submit button
}
}
},
@@ -103,6 +103,9 @@ export default {
}
},
methods: {
+ get () {
+ return Array.isArray(this.value) ? this.dates : this.dates[0]
+ },
cls () {
this.$emit('input', this.range ? [] : '')
},
@@ -115,8 +118,8 @@ export default {
},
ok () {
const $this = this
- $this.$emit('input', Array.isArray($this.value) ? $this.dates : $this.dates[0])
- setTimeout(() => {
+ $this.$emit('input', $this.get())
+ !$this.showButtons && setTimeout(() => {
$this.show = $this.range
})
},
@@ -154,7 +157,7 @@ export default {
this.show = this.$el.contains(e.target) && !this.disabled
},
submit () {
- this.$emit('dateRangeSelect', this.dates)
+ this.$emit('confirm', this.get())
this.show = false
},
cancel () {
@@ -319,8 +322,7 @@ export default {
font-size: 13px;
border: none;
cursor: pointer;
- margin: 10px 0 10px 5px;
- font-weight: 600;
+ margin: 10px 0 0 5px;
padding: 5px 15px;
color: #ffffff;
}
diff --git a/webpack.config.js b/webpack.config.js
index 8bef4b5..e01fca0 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -2,7 +2,7 @@ const path = require('path')
const webpack = require('webpack')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const banner =
- 'vue-datetime-local.js v1.0.9\n' +
+ 'vue-datetime-local.js v1.0.10\n' +
'(c) 2017-' + new Date().getFullYear() + ' weifeiyue\n' +
'Released under the MIT License.'
module.exports = {