Caner 3 years ago
parent
commit
c1bccc89d4
1 changed files with 10 additions and 9 deletions
  1. 10 9
      src/pages/index/views/home/index.vue

+ 10 - 9
src/pages/index/views/home/index.vue

@@ -1,23 +1,24 @@
 <script setup lang="ts">
 import NetService from '@/services/net.service'
-
+import { useRouter } from 'vue-router'
 const netService = new NetService()
+const router = useRouter()
 function sendAudio() {
   console.log(123)
-
+  router.push('/test')
   // netService.post('/sys/login', { userAccount: 1, userPwd: 'c4ca4238a0b923820dcc509a6f75849b' })
 }
 </script>
 <template>
   <div style="position: relative;">
-    <!-- <n-button type="primary">
-      我不是全局组件
-    </n-button> -->
-    <div
-      v-longPress="sendAudio"
-      style="position: absolute;top: 0;z-index: 2;"
+    <n-button
+      type="primary"
+      @click="sendAudio"
     >
+      我不是全局组件
+    </n-button>
+    <button v-longPress="sendAudio">
       test
-    </div>
+    </button>
   </div>
 </template>