• uniapp 日期操作


    <view class="promotionDetail-bot-title">
    					<view class="promotionDetail-bot-title-left">提成明细</view>
    					 <view class="promotionDetail-bot-title-right">
    						<view class="pDbtp-item">{{year||nowYear}}年</view>
    						<image class="pDbtp-icon" mode="widthFix" src="/static/index_72.png"></image>
    						<view class="pDbtp-item">{{month||nowMonth}}月</view>
    						<image class="pDbtp-icon" mode="widthFix" src="/static/index_72.png"></image>
    						<picker class="pDbtp-picker" :end='end' mode="date" fields="month" v-model="date" @change="dateChange">
    							<view class="pDbtp-picker-pad"></view>
    						</picker>
    					</view>
    				</view>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    data() {
    			return {
    				
    				year: '',
    				month: '',
    				nowYear: '',
    				nowMonth: '',
    			}
    		},
    
    onLoad(){
    			let now = new Date();
    			this.nowYear = now.getFullYear();
    			this.nowMonth = now.getMonth() + 1;
    			this.end = `${this.nowYear}-${this.nowMonth}`;
    		},
    
    
    
    
    
    // 选择时间
    			dateChange(e) {
    				console.log(e)
    				let date = e.detail.value;
    				this.year = date.match(/d{4}/)[0];
    				this.month = Number.parseInt(date.match(/-(d{2})/)[1]);
    			},
    

      

  • 相关阅读:
    Spring Cloud 模块简介2
    Eureka简介
    Spring Cloud 模块简介
    成神之路-基础篇 转
    Java面试题无答案
    java程序猿常用Linux命令
    Java工程师成神之路 转
    大型网站技术架构 大纲
    Mockito 相关资料
    webApp路由控制-vue-router2.0
  • 原文地址:https://www.cnblogs.com/zxyun/p/14028613.html
Copyright © 2020-2023  润新知