zoukankan      html  css  js  c++  java
  • 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]);
    			},
    

      

  • 相关阅读:
    论文尾注后无法插入分节符
    实现java对象排序的三种方式
    java数组的定义方式
    Canvas
    正则xss
    mongoDB学习记录
    查找,学习,记录
    地址
    node实战学习纪录
    nodejs学习记录
  • 原文地址:https://www.cnblogs.com/zxyun/p/14028613.html
Copyright © 2011-2022 走看看