xiongzhu 3 月之前
父节点
当前提交
4faa29c974
共有 3 个文件被更改,包括 8 次插入3 次删除
  1. 1 0
      deploy.sh
  2. 5 1
      src/views/Example.vue
  3. 2 2
      tsconfig.app.json

+ 1 - 0
deploy.sh

@@ -0,0 +1 @@
+rsync --exclude='node_modules/' -ravzh --delete -e "ssh -o StrictHostKeyChecking=no" ./dist/ root@8.210.167.152:/var/www/junma-show/

+ 5 - 1
src/views/Example.vue

@@ -42,6 +42,10 @@ function copyLink() {
   navigator.clipboard?.writeText(url);
 }
 
+function scrollToTop() {
+  window.scrollTo({ top: 0, behavior: "smooth" });
+}
+
 onMounted(() => {
   window.addEventListener("scroll", handleScroll, { passive: true });
 });
@@ -360,7 +364,7 @@ onBeforeUnmount(() => {
 
     <button
       v-show="showScrollTop"
-      @click="window.scrollTo({ top: 0, behavior: 'smooth' })"
+      @click="scrollToTop"
       class="fixed right-4 bottom-28 z-40 h-11 w-11 rounded-full bg-brand text-slate-900 shadow-lg grid place-items-center active:scale-95 transition"
       aria-label="回到顶部"
     >

+ 2 - 2
tsconfig.app.json

@@ -10,8 +10,8 @@
 
     /* Linting */
     "strict": true,
-    "noUnusedLocals": true,
-    "noUnusedParameters": true,
+    "noUnusedLocals": false,
+    "noUnusedParameters": false,
     "noFallthroughCasesInSwitch": true,
     "noUncheckedSideEffectImports": true,
     "verbatimModuleSyntax": false,