I have a component with unordered list and what I want to do is when component is loaded I want the component to be scrolled down to
<b-card no-body header="<i class='fa fa-align-justify'></i> Unorderd List" style="height: 680px">
<b-tabs card pills>
<b-tab v-for="debt in user_debts" :title="Debts list" :key="debt.id" class="card-height">
<table class="table table-sm amortization-header header-fixed">
<thead>
<tr>
<th>Month</th>
<th>Balance</th>
<th>Paid</th>
<th>Debt</th>
<th>Nominal Interest</th>
</tr>
</thead>
<tbody>
<tr v-for="month in amortization.schedule" :class="{'actual-month' : month.month == amortization.actual_month}">
<td>{{month.month}}</td>
<td>{{month.balance.toLocaleString()}}<span class="total">€</span></td>
<td>{{month.monthly_payment}}<span class="total">€</span></td>
<td>{{month.principle}}<span class="total">€</span></td>
<td>{{month.interest}}<span class="total">€</span></td>
</tr>
</tbody>
</table>
</b-tab>
</b-tabs>
</b-card>
You can use scrollIntoView:
mounted: function (){
var el = this.$el.getElementsByClassName("actual-month")[0];
el.scrollIntoView();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With