From d239fea7cafc2db4f6fb27cb2a1331b885c5e820 Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期五, 21 十月 2022 15:22:53 +0800
Subject: [PATCH] 34

---
 src/views/test.vue |   42 +++++++++++++++++++++++++++++++++++-------
 1 files changed, 35 insertions(+), 7 deletions(-)

diff --git a/src/views/test.vue b/src/views/test.vue
index 7c1bd47..148f527 100644
--- a/src/views/test.vue
+++ b/src/views/test.vue
@@ -1,19 +1,41 @@
 <template>
-    <div>hello  test page{{content}}</div>
-    <div>{{data.a}}</div>
-    <button @click="butclick">点击</button>
+    <van-calendar
+        title="透析排班"
+        :poppable="false"
+        :show-confirm="false"
+        @select="selectData"
+        :formatter="formatter"
+        :style="{ height: '400px' }"
+    />
 </template>
 <script lang="ts" setup>
     import {ref,reactive,watchEffect,watch} from 'vue'
+    import { Calendar as vanCalendar } from 'vant'
     const data=reactive({
         a:'chenyinc',
         h:'dadsad'
     })
-    const butclick=()=>{
-        data.a='你好'
-        content.value='haha'
-    }
     const content=ref('content')
+    const selectData=(data:any)=>{
+        console.log(data)
+    }
+    const formatter=(day:any)=>{
+        const month = day.date.getMonth() + 1
+        const date = day.date.getDate()
+
+        if (month === 9) {
+            if (date === 24) {
+                day.topInfo = '上午'
+                day.bottomInfo='8:30'
+                day.className='paibanclass'
+            } else if (date === 27) {
+                day.topInfo = '下午'
+                day.bottomInfo='13:00'
+                day.className='paibanclass'
+            }
+        }
+        return day
+    }
     watchEffect(()=>{
         const x1=data.a
         console.log('watchEffect所指定的回调执行了',x1)
@@ -23,4 +45,10 @@
     })
 
 </script>
+<style>
+    .paibanclass{
+        background: rgb(228, 231, 225);
+        color: blue;
+    }
+</style>
 

--
Gitblit v1.8.0