更新记录
1.0.2(2025-04-15) 下载此版本
增加参数和方法说明 以及参数显示优化
1.0.1(2025-04-02) 下载此版本
增加年份选择的代码示例
1.0.0(2025-04-02) 下载此版本
新增年份季度选择插件
查看更多平台兼容性
Vue2 | Vue3 |
---|---|
√ | × |
App | 快应用 | 微信小程序 | 支付宝小程序 | 百度小程序 | 字节小程序 | QQ小程序 |
---|---|---|---|---|---|---|
HBuilderX 3.95 | × | √ | × | × | × | × |
钉钉小程序 | 快手小程序 | 飞书小程序 | 京东小程序 | 鸿蒙元服务 |
---|---|---|---|---|
× | × | × | × | × |
H5-Safari | Android Browser | 微信浏览器(Android) | QQ浏览器(Android) | Chrome | IE | Edge | Firefox | PC-Safari |
---|---|---|---|---|---|---|---|---|
× | × | × | × | √ | √ | × | × | × |
cs-timeSeason
年份、年份季度选择器
此组件 提供了 年份选择 和 年份季度选择
默认为 年份季度选择
`
<template>
<view class="content">
<cs-timeSeason @timeSeasonC="timeSeasonF" ></cs-timeSeason>
</view>
</template>
<script>
export default {
data() {
return {
title: 'Hello'
}
},
onLoad() {
},
methods: {
timeSeasonF(val){
console.log('年:'+val.year+'季节:'+val.season,'年-季度:'+val.yearSeason);
}
}
}
</script>
`
其中可以手动调整年限范围
yearsMin(最小年限) yearsMax(最大年限) 必须为数字并且需要大于0 (默认都为5年) (以当前年为标准)
<cs-timeSeason @timeSeasonC="timeSeasonF" :yearsMin="1" :yearsMax="2"></cs-timeSeason>
`
增加 onlyYear 则可转换为年份选择器
`
<template>
<view class="content">
<cs-timeSeason @timeSeasonC="timeSeasonF" :yearsMin="1" :yearsMax="2" onlyYear></cs-timeSeason>
</view>
</template>
<script>
export default {
data() {
return {
title: 'Hello'
}
},
onLoad() {
},
methods: {
timeSeasonF(val){
console.log('年:'+val.year);
}
}
}
</script>
`
参数配置
属性名 | 类型 | 默认值 | 参数说明 |
---|---|---|---|
yearsMin | Number | 5 | 以当前年为基准往前推多少年(默认5年) |
yearsMax | Number | 5 | 以当前年为基准往后推多少年(默认5年) |
onlyYear | Boolean | false | 默认为年季度选择器 为true时 为年份选择器 |
方法配置
方法名 | 类型 | 参数说明 |
---|---|---|
timeSeasonF | Function | 为年季度选择时 year(年) season(季度) yearSeason(年季度)。为年份选择时 year(年) |