This commit is contained in:
2019-03-01 20:10:05 +00:00
parent 027de3694f
commit 5d3d7a6ae6

View File

@@ -0,0 +1,56 @@
<script>
export default {
props: {
value: {
type: String,
default: ""
}
},
render() {
return this.$createElement("v-date-picker", {
props: {
...this.$attrs,
value: this.value ? this.value.substr(0, 10) : null
},
on: {
...this.$listeners,
input: date => this.$emit("input", new Date(date).toISOString())
}
});
},
computed: {
listeners() {
return {
// Pass all component listeners directly to input
...this.$listeners,
// Override input listener to work with v-model
input: event => this.$emit("input", event.target.value)
};
}
}
};
</script>
// props: {
// value: String
// },
// data: function() {
// return {
// ogdate: ""
// };
// },
// render() {
// return this.$createElement("v-date-picker", {
// props: {
// ...this.$attrs,
// value: this.value ? this.value.substr(0, 10) : null
// },
// on: {
// ...this.$listeners,
// input: date => this.$emit("input", new Date(date).toISOString())
// }
// });
// }