vxe-table icon indicating copy to clipboard operation
vxe-table copied to clipboard

同一个页面的多表格编辑功能报错

Open jarrekk opened this issue 3 years ago • 2 comments

可复现的链接:

No

问题描述与截图:

我在tab标签页当中切换table,但是每个table的ref都是xTable,激活编辑的代码是copy文档里面的

<div v-for="(table, index) in tableDatas" :key="'b' + index">
                <div v-if="activeTab === table[0][0]">
                  <vxe-table
                    show-overflow
                    align="null"
                    :data="table[1]"
                    keep-source
                    ref="xTable"
                    :edit-config="{trigger: 'manual', mode: 'row'}"
                    :scroll-y="{enabled: false}">

...
<vxe-column title="Action" width="130" align="center">
  <template #default="{ row }">
    <template v-if="$refs.xTable.isEditByRow(row)">
      < vxe-button @click="cancelRowEvent(row, false)">Save</vxe-button>
      < vxe-button @click="cancelRowEvent(row, true)">Cancel</vxe-button>
    </template>
    <template v-else>
      < vxe-button @click="editRowEvent(row); updateData();" >Edit</vxe-button>
    </template>
  </template>
</vxe-column>
image

期望的结果:

无报错

操作系统:

Mac 12.5.1

浏览器版本:

Chrome 105.0.5195.125

vue 版本:

"vue": "^2.6.14",

vxe-table 版本:

"vxe-table": "^3.3.14",

jarrekk avatar Sep 21 '22 03:09 jarrekk

isActiveByRow 方法也用过了,同样的报错,表格的内容无法正常显示 image 正常显示应该是 image

jarrekk avatar Sep 21 '22 03:09 jarrekk

双击编辑模式不会报错,只有isActiveByRowisEditByRow会报错

jarrekk avatar Sep 21 '22 04:09 jarrekk