Ber*_*oci 3 javascript vue.js vuejs2
我有一个具有无序列表的组件,我要做的是在加载组件时将组件向下滚动到
<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>
Run Code Online (Sandbox Code Playgroud)
您可以使用scrollIntoView:
mounted: function (){
var el = this.$el.getElementsByClassName("actual-month")[0];
el.scrollIntoView();
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4216 次 |
| 最近记录: |