vue.js - Vuetify,v-data-table headers 值的用途
问题描述
对象数组中的value
属性的目的是什么?headers
v-data-table
在文档中它说
An array of objects that each describe a header column. See the example below for a definition of all properties.
{
text: string",
value: string",
align: 'left' | 'center' | 'right'",
sortable: boolean",
class: string[] | string",
width: string"
}
但它从未真正解释过它的目的。
标头对象是否只需要一个唯一键或者我可以value
在 html 中使用它吗?
解决方案
当您将该列定义为sortable: true
时,它将是在分页对象上设置的值,而不是文本。
例如,我的列名为Created at
(text),其值为created_at
. 这使我可以查看分页对象,并直接按数据发送订单,而无需额外的映射步骤,因为我的 API 期望值为orderBy
要么 要么created_at
没有。
推荐阅读
- session - asp.net core azure 会话管理
- ios - UICollectionViewController 使单元格覆盖全宽
- python - Python 控制台中的文本工具提示
- javascript - React Redux:TypeError:store.getState 不是函数
- c# - 从 C# 中的文件夹和子文件夹中获取文件名
- react-native - 条码扫描到反应原生应用程序 TextInout 缺少字符
- react-native - React Native 性能监控
- api - VueJS POST http://127.0.0.1:8000/login 404(未找到)
- node.js - 处理高负载的 Node.js 后端
- pytorch - CUDA 内存不足。尝试分配 14.00 MiB(GPU 0;4.00 GiB 总容量;2 GiB 已分配;6.20 MiB 空闲;2GiB 由 PyTorch 保留)