更新记录

1.0.1(2021-11-01)

bug修改

1.0.0(2021-07-12)

日期、时间选择器v1.0.0


平台兼容性

Vue2 Vue3
×
App 快应用 微信小程序 支付宝小程序 百度小程序 字节小程序 QQ小程序
HBuilderX 3.1.18 app-vue app-nvue
钉钉小程序 快手小程序 飞书小程序 京东小程序
× × × ×
H5-Safari Android Browser 微信浏览器(Android) QQ浏览器(Android) Chrome IE Edge Firefox PC-Safari

日期、时间选择器

JS代码

<template>
    <view class="cell">
        <view class="title">开始时间</view>
        <view class="width100" @click="dateOpen('hopeBeginTime', hopeBeginTime)">
            <text class="text1" v-if="hopeBeginTime">{{ hopeBeginTime }}</text>
            <text class="text1 color3" v-else>请选择</text>
        </view>
        <my-datetime ref="dateTimePop" @ok="timeOk"></my-datetime>
    </view>
</template>

<script>
import myDatetime from '@/components/my-datetime/my-datetime'
export default { 
    components: {
      'my-datetime': myDatetime
    },
        data() {
            return {
                hopeBeginTime: '',
                dateKey: ''
            };
        },
    methods: {
        // 开启弹窗
        dateOpen (key, date) {
            this.dateKey = key
            this.$refs.dateTimePop.open(date || '');
        },
        // 关闭弹窗
        timeOk (str, obj) {
            console.log(str, obj)
            this[this.dateKey] = str || ''
        }
    }
}
</script>
| 属性          | 说明          | 默认值  |
| ------------- | ------------- | ------- |
| titleShow     | 标题是否显示  |   true  |
| shownum       | 显示几位      |   6     |

shownum: 1年, 2年月,3年月日 ,4年月日时, 5年月日时分,6年月日时分秒 事件ok

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

插件不采集任何数据

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

许可协议

MIT协议

使用中有什么不明白的地方,就向插件作者提问吧~ 我要提问