|
@@ -43,14 +43,19 @@
|
|
|
<script lang="ts" setup>
|
|
|
import sujectOne from "./components/sujectOne.vue";
|
|
|
import userData from "./components/userData.vue";
|
|
|
-import { ref, nextTick } from "vue";
|
|
|
+import { ref, nextTick, onBeforeMount } from "vue";
|
|
|
import { useStore } from "vuex";
|
|
|
const store = useStore();
|
|
|
|
|
|
const carTypeRef = ref<any>(null);
|
|
|
-nextTick(() => {
|
|
|
- carTypeRef.value.scrollTo(store.state.carType);
|
|
|
+onBeforeMount(() => {
|
|
|
+ nextTick(() => {
|
|
|
+ try {
|
|
|
+ carTypeRef.value.scrollTo(store.state.carType);
|
|
|
+ } catch (error) {}
|
|
|
+ });
|
|
|
});
|
|
|
+
|
|
|
const carTypeChange = (e: string) => {
|
|
|
store.commit("setCatType", e);
|
|
|
};
|