Happy-Coding-Clans / vue-easytable

A powerful data table based on vuejs. You can use it as data grid、Microsoft Excel or Google sheets. It supports virtual scroll、cell edit etc.

Home Page:https://happy-coding-clans.github.io/vue-easytable/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug Report] expandOption.render 解析冲突

GuoSirius opened this issue · comments

选择要提交 issue 的库

vue-easytable

Issue 类型

Bug

Issue 标题

expandOption.render 解析冲突

仓库版本

v2.27.1

Vue 版本

2.7.14

浏览器

Chrome 113

系统类型

Windows

重现链接

http://baidu.com

重现步骤

计算属性
const expandOption = computed(() => {
return { render: () => '123' }
})

期望的结果是什么?

能正常解析,不使用 render 属性,更换属性

实际的结果是什么?

被解析成 组件

const expandOption = computed(() => {
  return { render: () => '123' }
})

image

没明白你的需求

没明白你的需求

对组件做了一个二次封装,如下:

// CustomETable.vue
<template>
  <ve-table :expand-option="realExpandOption" />
</template>

<script setup>
// vue 2.7.14
import { computed } from 'vue

const props = {
  trigger: {
    type: String,
    default: 'icon'
  }
}

const realExpandOption= computed(() => {
  const { trigger } = props

  return { trigger, render: () => '这里返回渲染组件' }
})
<script>

realExpandOption 应该是一个计算属性,但是 在 vue-devtools 里看到被解析为 未知组件, 导致 展开按钮能看到,但是不能操作,操作无效