简体   繁体   中英

How to create an exchange-like progress bar behind data-table elements? [Vue/Vuetify]

I'm making an exchange book simulator for some cryptocurrencies, and I need to make the progress bar that is behind the values of a table.

在此处输入图像描述

My data.table that receives the data has the following template:

                    <v-data-table
                        :headers="headers_ask"
                        :items="book_item[1]"
                        class="transparent data-table-books-asks ml-3 mr-3"
                    >
                      <template v-slot:item="{item}">
                          <tr>
                            <td>{{item.ask}}</td>
                            <td>{{item.quantity}}</td>
                          </tr>
                      </template>
                    </v-data-table>

How can I create this progress bar on data.table elements without affecting the layout of the template? Note: if I create a div or other tag between that template the items do not match the header

I made it using a background property on the template elements:

<tr :style="{'background-image': 'linear-gradient(to left, rgba(255, 59, 105, 0.25), rgba(255, 59, 105, 0.25) '+item.percentage+'%, rgba(0, 0, 0, 0) '+item.percentage+'%)'}">
  <td class="text-start items-ask">{{item.ask}}</td>
  <td class="text-center items-quantity">{{item.quantity}}</td>
</tr>

Thank you folks!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM