增加 setRow 方法

This commit is contained in:
xuliangzhan
2024-05-30 17:05:51 +08:00
parent 1724667fc1
commit 52c41baa7c
3 changed files with 16 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "vxe-table",
"version": "3.8.7",
"version": "3.8.8-beta.0",
"description": "一个基于 vue 的 PC 端表单/表格组件支持增删改查、虚拟树、列拖拽懒加载、快捷菜单、数据校验、树形结构、打印导出、自定义模板、渲染器、JSON 配置式...",
"scripts": {
"update": "npm install --legacy-peer-deps",

View File

@@ -518,6 +518,19 @@ const Methods = {
return this.recalculate()
})
},
/**
* 修改行数据
*/
setRow (rows, record) {
if (record) {
let rest = rows
if (!XEUtils.isArray(rows)) {
rest = [rows]
}
rest.forEach(item => Object.assign(item, record))
}
return this.$nextTick()
},
/**
* 局部加载行数据并恢复到初始状态
* 对于行数据需要局部更改的场景中可能会用到

View File

@@ -160,8 +160,8 @@
flex-direction: column;
align-items: initial;
.vxe-form--item-title {
height: 2.2em;
line-height: 2.2em;
height: 2.5em;
line-height: 2.3em;
padding-right: 0;
max-width: none;
}