From 76b2fa4771cb898e09017c88d6ebf7f93d9ab46c Mon Sep 17 00:00:00 2001 From: MoreStrive Date: Mon, 8 Jul 2024 17:03:33 +0700 Subject: [PATCH] minhnt-dev: scroll smooth --- assets/styles/style.scss | 1 + .../templates/sections/articles/Default.vue | 18 ++++++++---------- nuxt.config.ts | 4 ++++ plugins/scroll.plugin.ts | 5 +++++ 4 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 plugins/scroll.plugin.ts diff --git a/assets/styles/style.scss b/assets/styles/style.scss index 4ac11b6..ca167d5 100644 --- a/assets/styles/style.scss +++ b/assets/styles/style.scss @@ -20,6 +20,7 @@ $color-line: #EDEDED; body { font-size: 14px; font-family: $font-raleway; + scroll-behavior: smooth; } // %headings { diff --git a/components/dynamic-page/page-component/templates/sections/articles/Default.vue b/components/dynamic-page/page-component/templates/sections/articles/Default.vue index 52343ae..ddf89dc 100644 --- a/components/dynamic-page/page-component/templates/sections/articles/Default.vue +++ b/components/dynamic-page/page-component/templates/sections/articles/Default.vue @@ -4,10 +4,7 @@ import { getInputValue } from "@/utils/parseSQL"; import { enumPageComponentTemplates } from "@/definitions/enum"; const router = useRouter(); const route = useRoute(); - -const store = reactive({ - component: useDynamicPageStore(), -}); +import { useScroll } from '@vueuse/core'; const _props = defineProps<{ dataResult?: any[]; @@ -108,10 +105,11 @@ const mapActivesToItems = (index: number) => { } return {}; }; +