首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >编辑v-数据表

编辑v-数据表
EN

Stack Overflow用户
提问于 2019-06-28 13:37:35
回答 1查看 8K关注 0票数 0

日安。我试图编辑我的v数据表,以满足我个人对行和语言的需求。我成功地编辑了几个字段,但我找不到一种方法来编辑"1-50 of 300“中的"of”。

我正在阅读文档,但我不知道如何改变它。

数据表

这里是我当前的v-数据表文档:

代码语言:javascript
复制
   <v-data-table
    :headers="headers"
    :items="myItems"
    :search="search"
    no-results-text='LMAO NO DATA'
    rows-per-page-text='Data'
    :rows-per-page-items="[5, 50, 100, {text:'EVERYTHING', value: -1}] "
    class="elevation-3"
   >

编辑: Sejir Ben Ali的答案是正确的,但是如果您出现了错误,请使用以下方法:

代码语言:javascript
复制
<template v-slot:[`footer.page-text`]="props">
      itens {{ props.pageStart }} - {{ props.pageStop }} of {{ props.itemsLength }}
</template>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-06-28 13:59:42

来自文档(槽: pageText - https://vuetifyjs.com/en/components/data-tables#slot-pagetext):

可以使用pageText槽自定义显示范围和总项的页面文本。

代码语言:javascript
复制
<template>
  <v-data-table
    :headers="headers"
    :items="desserts"
    class="elevation-1"
  >
    <template v-slot:items="props">
      <td>{{ props.item.name }}</td>
      <td class="text-xs-right">{{ props.item.calories }}</td>
      <td class="text-xs-right">{{ props.item.fat }}</td>
      <td class="text-xs-right">{{ props.item.carbs }}</td>
      <td class="text-xs-right">{{ props.item.protein }}</td>
      <td class="text-xs-right">{{ props.item.iron }}</td>
    </template>
    <template v-slot:pageText="props">
      ITEMS {{ props.pageStart }} - {{ props.pageStop }} OF {{ props.itemsLength }} // Edit this
      // ^this is what you need
    </template>
  </v-data-table>
</template>
票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56807999

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档