Skip to content
TheChatArchiveThe Chat Archive
gpt-3.5-turbo-0301· openaiHugging Face Suzhen/CodeChat

<vxe-table show-footer :scroll-y="{enabled: false}" align="center" ref="xTable"…

  1. User

    差异 显示 应出减去实出的值

  2. Assistant

    可以使用计算属性来实现,在表格中添加一个自定义的 column,计算出差异值,代码如下:

    <vxe-column title="差异" align="center" width="95">
      <template slot-scope="{ row }">{{ row.planAmount - row.doneAmount }}</template>
    </vxe-column>
    

    其中,row 为当前数据行的对象,通过 row.planAmount - row.doneAmount 计算出差异值,然后在模板中显示出来即可。