• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
    • Questions
    • Teachers
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

90
Views
Display html element after v-for loop was finished

I have object with elements and I use v-for loop to dispaly them on page:

    <template v-for="(item, index) in myObject">
      <v-row :key="index">
          <v-col>
            <v-text-field
              v-model="item.value"
              :label="item.name"
            />
          </v-col>
        </v-row>
    </template>
 
    <!-- additional TextField -->
    <v-row>
      <v-col>
        <v-text-field
          v-model="modifyDateTime"
          label="Modify date and time"
        />
      </v-col>
    </v-row>

It works fine, but I added additional v-text-field below after v-for block and it shows up earlier than elements in v-for loop rendered.

How can I solve this problem? I need to display the last v-text-field element right after elements v-for loop was rendered

almost 3 years ago · Juan Pablo Isaza
1 answers
Answer question

0

use v-if in loop

<template v-for="(item, index) in myObject">
          <v-row :key="index">
              <v-col>
                <v-text-field
                  v-model="item.value"
                  :label="item.name"
                />
              </v-col>
            </v-row>
            <!-- additional TextField -->

                <v-row v-if="index == Object.keys(item).length - 1">
                  <v-col>
                    <v-text-field
                      v-model="modifyDateTime"
                      label="Modify date and time"
                    />
                  </v-col>
                </v-row>
        </template>
 
          
almost 3 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error