首页 > 解决方案 > 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>

标签: datatableprimevue

解决方案


推荐阅读