From bad530e42aa054f0cbbf32d377162eaeacd8ce26 Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期五, 28 十月 2022 10:35:49 +0800
Subject: [PATCH] 45

---
 src/views/paiban/index.vue |    5 --
 src/views/vuetool/index.js |   15 +++++++
 tsconfig.json              |    2 
 src/views/test.vue         |   47 +++--------------------
 4 files changed, 22 insertions(+), 47 deletions(-)

diff --git a/src/views/paiban/index.vue b/src/views/paiban/index.vue
index 959efba..1c18325 100644
--- a/src/views/paiban/index.vue
+++ b/src/views/paiban/index.vue
@@ -56,7 +56,6 @@
     </div>
 </template>
 <script lang="ts" setup>
-    // import {ref,reactive,watchEffect,watch} from 'vue'
     import { Calendar as vanCalendar } from 'vant'
     import { ref,onMounted } from 'vue'
     import {useRouter} from 'vue-router'
@@ -84,10 +83,6 @@
             year:y,
             month:m,
         }
-        const lisd = selectDate.value.filter(el=>{
-            return el.y!==pagedata.year&&el.m!==pagedata.month
-        })
-        selectDate.value=lisd
         ajaxPost('/hemo/med/schedule/listMonthSchedulesByPat',pagedata).then((re:any)=>{
             console.log(re)
             re.forEach((element:any) => {
diff --git a/src/views/test.vue b/src/views/test.vue
index 148f527..4bc7219 100644
--- a/src/views/test.vue
+++ b/src/views/test.vue
@@ -1,48 +1,13 @@
 <template>
-    <van-calendar
-        title="透析排班"
-        :poppable="false"
-        :show-confirm="false"
-        @select="selectData"
-        :formatter="formatter"
-        :style="{ height: '400px' }"
-    />
+    <div class="test">
+        {{a}}
+        <button @click="actionA">点我呀</button>
+    </div>
 </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 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)
-    })
-    watch(content,(newValue,oldValue)=>{
-        console.log(newValue,oldValue,'变化了')
-    })
+    import usePage from './vuetool/index.js'
+    const {a,actionA} = usePage()
 
 </script>
 <style>
diff --git a/src/views/vuetool/index.js b/src/views/vuetool/index.js
new file mode 100644
index 0000000..359f7b8
--- /dev/null
+++ b/src/views/vuetool/index.js
@@ -0,0 +1,15 @@
+import {ref} from 'vue'
+export default ()=>{
+    const a = ref(0)
+    const b = ref('')
+    const c = ref(true)
+    const actionA = ()=>{a.value++}
+    const actionC = ()=>{c.value=!c.value}
+    const actionB = ()=>{b.value += 'test' }
+    // 这时候需要写return
+    return {
+        a,actionA,
+        b,actionB,
+        c,actionC
+    }
+}
\ No newline at end of file
diff --git a/tsconfig.json b/tsconfig.json
index 19fa6f7..7a37b06 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -22,7 +22,7 @@
     },
     
   },
-  "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue", "src/api/user.js"],
+  "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue", "src/api/user.js", "src/views/vuetool/index.js", "src/views/vuetool/index.js"],
   "exclude": ["node_modules","dist"],
   "references": [{ "path": "./tsconfig.node.json" }]
 }

--
Gitblit v1.8.0