瀏覽代碼

calendar today

zizhong.wang 3 年之前
父節點
當前提交
23a1fc7c95
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      components/lx-calendar/lx-calendar.vue

+ 3 - 3
components/lx-calendar/lx-calendar.vue

@@ -15,7 +15,7 @@
 				<view class="date_dl" v-show="!retract || index == to_prev_week_index" v-for="(item,index) in   week_list_prev_co" :key="index">
 					<view class="dd" @click="item_click(vo,index,key)" v-for="(vo,key) in item" :key="key">
 						<!-- <view class="num" :class="[vo.today ? 'today' : '',vo.type == 'month' ? 'month' : (retract ? '' : 'disabled')]">{{vo.day}}</view> -->
-						<view class="num" :class="[vo.today ? 'today' : '', vo.dot ? '' : 'disabled']">{{vo.day}}</view>
+						<view class="num" :class="[vo.today && currentMonth == nowMonth ? 'today' : '', vo.dot ? '' : 'disabled']">{{vo.day}}</view>
 						<view v-show="vo.dot && (vo.type == 'month' || retract)" class="dot"></view>
 					</view>
 				</view>
@@ -26,7 +26,7 @@
 				<view class="date_dl" v-show="!retract || index == to_week_index" v-for="(item,index) in week_list" :key="index">
 					<view class="dd" @click="item_click(vo,index,key)" v-for="(vo,key) in item" :key="key">
 						<!-- <view class="num" :class="[vo.today ? 'today' : '',vo.type == 'month' ? 'month' : (retract ? '' : 'disabled')]">{{vo.day}}</view> -->
-						<view class="num" :class="[vo.today ? 'today' : '', vo.dot ? '' : 'disabled']">{{vo.day}}</view>
+						<view class="num" :class="[vo.today && currentMonth == nowMonth ? 'today' : '', vo.dot ? '' : 'disabled']">{{vo.day}}</view>
 						<view v-show="vo.dot && (vo.type == 'month' || retract)" class="dot"></view>
 					</view>
 				</view>
@@ -37,7 +37,7 @@
 				<view class="date_dl" v-show="!retract || index == to_next_week_index" v-for="(item,index) in  week_list_next_co" :key="index">
 					<view class="dd" @click="item_click(vo,index,key)" v-for="(vo,key) in item" :key="key">
 						<!-- <view class="num" :class="[vo.today ? 'today' : '',vo.type == 'month' ? 'month' : (retract ? '' : 'disabled')]">{{vo.day}}</view> -->
-						<view class="num" :class="[vo.today ? 'today' : '', vo.dot ? '' : 'disabled']">{{vo.day}}</view>
+						<view class="num" :class="[vo.today && currentMonth == nowMonth ? 'today' : '', vo.dot ? '' : 'disabled']">{{vo.day}}</view>
 						<view v-show="vo.dot && (vo.type == 'month' || retract)" class="dot"></view>
 					</view>
 				</view>