datatable - html内的primevue可编辑数据表
问题描述
在 primevue 帮助中 其他替代方法是直接在浏览器中使用组件
你有任何可编辑数据表的例子吗?
<div class="card">
<h5>Advanced Cell Editing</h5>
<p>Custom implementation with validations, dynamic columns and reverting values with the escape key.</p>
<DataTable :value="products" editMode="cell" @cellEditComplete="onCellEditComplete" class="editable-cells-table" responsiveLayout="scroll">
<Column v-for="col of columns" :field="col.field" :header="col.header" :key="col.field" :editable="true" style="width:25%">
<template #editor="slotProps">
<InputText :modelValue="slotProps.data[slotProps.column.props.field]" @update:modelValue="onCellEdit($event, slotProps)" />
</template>
</Column>
</DataTable>
</div>
解决方案
推荐阅读
- winapi - 检测窗口是否正在使用硬件加速的图形上下文
- html - 如何在 flexbox 中居中内容
- c - C 中的尾递归总是比经典递归更快,如果是,我该如何修复我的代码?
- r - 将维恩图转换为 grob?
- javascript - 如何更新 Mongo 文档数组中的对象(在特定索引处)
- directory - 什么词或短语专门表示“..”,即目录导航操作的“转到父目录”参数?
- php - 400 错误请求 - 带有 Jquery 和 Wordpress 的 Ajax
- coldfusion - textareas 中的额外换行符/Microsoft Edge 或 encodeForHTML (ColdFusion) 问题
- c++ - SDL 2,如何使用事件系统和异步绘制
- python - 数据驱动的测试。使用 Selenium Python 从 .json 或 .yaml 文件中读取参数