Ver código fonte

اسکرول به نمایش تیکت در انتهای پاسخ نامه

hgh 1 ano atrás
pai
commit
d363f09629
1 arquivos alterados com 9 adições e 1 exclusões
  1. 9 1
      src/components/Widgets/Test/TestShow/TestShow.vue

+ 9 - 1
src/components/Widgets/Test/TestShow/TestShow.vue

@@ -8,7 +8,7 @@
                outline
                color="primary"
                class="btn-need-installment"
-               :to="{name: 'UserPanel.Ticket.Show', params: {id: answerBook.ticket}}">
+               @click="scrollToObjectionBox">
           مشاهده اعتراض
         </q-btn>
       </q-card-section>
@@ -134,6 +134,7 @@
     </div>
   </div>
   <q-card v-if="!answerBook.loading && answerBook.ticket"
+          ref="objectionBox"
           class="q-mt-md">
     <div class="q-mb-md">متن:</div>
     <div>{{ ticket_info.body }}</div>
@@ -246,6 +247,13 @@ export default {
     this.mounted = true
   },
   methods: {
+    scrollToObjectionBox() {
+      this.$nextTick(() => {
+        if (this.$refs.objectionBox && this.$refs.objectionBox.$el) {
+          this.$refs.objectionBox.$el.scrollIntoView({ behavior: 'smooth', block: 'start' })
+        }
+      })
+    },
     miladiToShamsi (miladi) {
       return Assist.miladiToShamsi(miladi)
     },