瀏覽代碼

remove the contact-me inner link for a scroll directive

olinox14 1 年之前
父節點
當前提交
035ffa6426
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      pages/index.vue

+ 5 - 1
pages/index.vue

@@ -50,7 +50,7 @@
     <div class="banner-buttons">
       <DownloadPdfBtn />
 
-      <v-btn variant="outlined" to="#contact" :active="false">
+      <v-btn variant="outlined" :active="false" @click="onContactMeClick">
         {{$t('contact_me')}}
       </v-btn>
     </div>
@@ -125,6 +125,10 @@ const CURRENT_YEAR = new Date().getFullYear();
 const XP_YEARS = CURRENT_YEAR - START_YEAR
 
 const showLongIntro: Ref<boolean> = ref(false)
+
+const onContactMeClick = () => {
+  window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' });
+}
 </script>
 
 <style scoped lang="scss">