feat: add lenis
This commit is contained in:
11
src/App.vue
11
src/App.vue
@@ -1,6 +1,17 @@
|
||||
<script lang="ts" setup>
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { useLanguageStore } from "./stores/LanguageStore";
|
||||
import Lenis from "lenis";
|
||||
|
||||
// 开启 lenis 平滑滚动
|
||||
const lenis = new Lenis();
|
||||
|
||||
function raf(time) {
|
||||
lenis.raf(time);
|
||||
requestAnimationFrame(raf);
|
||||
}
|
||||
|
||||
requestAnimationFrame(raf);
|
||||
|
||||
onMounted(() => {
|
||||
// 加载 i18n 初始语言
|
||||
|
||||
@@ -5,6 +5,7 @@ import router from "./router";
|
||||
import i18n from "./i18n";
|
||||
import { createPinia } from "pinia";
|
||||
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
|
||||
import "lenis/dist/lenis.css";
|
||||
|
||||
const pinia = createPinia();
|
||||
pinia.use(piniaPluginPersistedstate);
|
||||
|
||||
Reference in New Issue
Block a user