This commit is contained in:
56
ayanova/src/components/gzdatepicker.vue
Normal file
56
ayanova/src/components/gzdatepicker.vue
Normal 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())
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user