Browse Source

调整拖动属性

caner 1 year ago
parent
commit
373d982cc7
2 changed files with 23 additions and 9 deletions
  1. 5 1
      src/components/loading.vue
  2. 18 8
      src/pages/login/index.vue

+ 5 - 1
src/components/loading.vue

@@ -1,5 +1,8 @@
 <template>
-  <div class="bg">
+  <div
+    class="bg"
+    data-tauri-drag-region
+  >
     <div class="loader" />
   </div>
 </template>
@@ -17,6 +20,7 @@
     z-index: 9;
     border-radius: 8px;
     overflow: hidden;
+    cursor: grabbing;
 }
 
 .loader {

+ 18 - 8
src/pages/login/index.vue

@@ -1,10 +1,21 @@
 <template>
-  <div class="login">
+  <div
+    class="login"
+    data-tauri-drag-region
+  >
     <topBar />
     <div class="login-content">
-      <div class="login-content-left" />
-      <div class="login-content-right">
-        <p>Hello, 欢迎登录</p>
+      <div
+        class="login-content-left"
+        data-tauri-drag-region
+      />
+      <div
+        class="login-content-right"
+        data-tauri-drag-region
+      >
+        <p data-tauri-drag-region>
+          Hello, 欢迎登录
+        </p>
         <div>
           <Icon
             name="server"
@@ -87,8 +98,8 @@ async function login() {
   align-items: center;
   background: url(@/assets/img/bg.png) center center no-repeat;
   background-size: 100% 100%;
-  -webkit-app-region: drag;
   position: relative;
+  cursor: grabbing;
 
   &-content {
     width: 800px;
@@ -102,7 +113,6 @@ async function login() {
       width: 500px;
       background: url(@/assets/img/login-left.png) center center no-repeat;
       background-size: 100% 100%;
-      -webkit-app-region: drag;
     }
 
     &-right {
@@ -117,8 +127,8 @@ async function login() {
         text-align: left;
         font-weight: 400;
         text-align: center;
-        margin-top: 50px;
-        margin-bottom: 50px;
+        padding: 50px 0;
+        margin: 0;
       }
 
       &>div {