123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <template>
- <uni-datetime-picker
- ref="calendarRef"
- v-model="innerValue"
- :type="type"
- @change="confirm"
- :hide-second="hideSecond"
- >
- <text></text>
- </uni-datetime-picker>
- </template>
- <script>
- export default {
- props: {
- value: {
- type: String | Number | Array,
- default: function() {
- return null
- }
- },
-
- //展示格式
- type: {
- type: String,
- default: 'datetimerange'
- },
- hideSecond: {
- type: Boolean,
- default: true
- },
-
- },
-
- watch: {
- value: {
- handler(newVal) {
- this.innerValue = newVal
- }
- },
- innerValue: {
- handler(newVal) {
- this.$emit('input', newVal)
- }
- },
- },
- computed: {
-
- },
- data() {
- return {
- innerValue: null,
- }
- },
- onReady() {
-
- },
-
- methods: {
-
- show() {
- this.$refs.calendarRef.show()
- },
-
- reset() {
- this.innerValue = null;
- },
-
- confirm(e) {
- this.$emit('confirm',e)
- },
-
-
- }
- }
- </script>
- <style lang="scss" scoped>
-
- </style>
|