Coder Social home page Coder Social logo

x-extends / vxe-table-plugin-element Goto Github PK

View Code? Open in Web Editor NEW
93.0 2.0 24.0 727 KB

🌲 基于 vxe-table 表格的适配插件,用于兼容 element-ui、element-plus 组件库

License: MIT License

JavaScript 8.14% TypeScript 86.66% SCSS 5.21%
vxe-table

vxe-table-plugin-element's People

Contributors

xuliangzhan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vxe-table-plugin-element's Issues

ElSelect option的value不能为数字

(必填)请填写问题描述 Describe the bug

ElSelect option的value如果是数字的话,筛选按钮不能点击

(必填)请填写能重现问题的链接

https://codesandbox.io/s/vxe-table-ceshide-demo-pt4wg?file=/src/views/Demo1.vue

填写报错信息或截图 Error message or screenshots

option.value为数字时的效果

Kapture 2020-04-23 at 17 37 50

option.value为字符串时的效果

Kapture 2020-04-23 at 17 43 50

(必填)请填写期望的结果 Expected behavior

option.value为数字时的筛选按钮也能正常使用

vue-tsc不通过 resolveComponent不接受可空name

可复现的链接:

https://github.com/x-extends/vxe-table-plugin-element/blob/master/index.ts

问题描述与截图:

vxe-table-plugin-element/index.ts:694:41 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
Type 'undefined' is not assignable to type 'string'.

期望的结果:

vue-tsc通过

操作系统:

10

浏览器版本:

版本 104.0.1293.70 (正式版本) (64 位)

vue 版本:

3.2.37

vxe-table 版本:

4.3.2

Unknown custom element

I don't know what is the problem but I can't use the cell demo that you provided on the readme.

import Vue from 'vue'
import 'xe-utils'
import VXETable from 'vxe-table'
import 'vxe-table/lib/index.css'
import VXETablePluginElement from 'vxe-table-plugin-element'
import 'vxe-table-plugin-element/dist/style.css'
import VueI18n from 'vue-i18n'
import enUS from 'vxe-table/lib/locale/lang/en-US'

Vue.use(VueI18n)
const messages = {
  en_US: {
    ...enUS
  }
}

const i18n = new VueI18n({
  locale: 'en_US',
  messages
})

Vue.use(VXETable, {
  i18n: key => i18n.t(key)
})

VXETable.use(VXETablePluginElement)

Screen Shot 2020-05-02 at 21 06 22

Could you please help me? I need to add a multiple select to my modal form and because of that I wanna add element-ui for using that.

请问一下在grid的formConfig里使用这个插件之后 搜索不会联动了是该如何解决的

这个需求解决了什么问题:

请问一下在grid的formConfig里使用这个插件之后 搜索不会联动了是该如何解决的
替代了样式生效了,但是点击查询按钮没任何反应

{ span: 24, align: 'center', collapseNode: true, itemRender: { name: 'ElButtons', children: [{ props: { type: 'submit', content: '查询', status: 'primary'} }, { props: { type: 'reset', content: '重置' } }] } }

建议的 API 是什么样的:

No response

是否已有其他不错的替代方案:

No response

renderOptions 能否增加disabled项

function renderOptions(h, options, optionProps) {
var labelProp = optionProps.label || 'label';
var valueProp = optionProps.value || 'value';
++var disabledProp = optionProps.disabled || 'disabled';
return _xeUtils["default"].map(options, function (item, index) {
return h('el-option', {
props: {
value: item[valueProp],
label: item[labelProp],
++disabled:item[disabledProp]
},
key: index
});
});
}
在编辑表格时,不同的行,允许选择的值可能不同,通过disabled禁用不允许的值

通不过 vue-tsc 检查

可复现的链接:

import { VXETablePluginElement } from "vxe-table-plugin-element";

问题描述与截图:

只需要在源代码中引入,再跑 vue-tsc 或者 vue-tscc --noEmit 就会报错

image


查看了库文件,

package.json 中 typings 声明为 index.ts
似乎应该是 index.d.ts(相应地改文件名)

期望的结果:

No response

操作系统:

Windows 10

浏览器版本:

Microsoft Edge 103.0.1264.62

vue 版本:

3

vxe-table 版本:

x

如何增加其他的筛选,例如ElSelect筛选

这个新特性和一个问题相关吗?简单描述下,比如我什么场景下,需要解决什么问题,发现表格不支持这个功能 Is your feature request related to a problem? Please describe.

描述下,你希望得到的什么解决方案 Describe the solution you'd like

是否有不错的替代方案 Describe alternatives you've considered

Add some @ts-ignore

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/vxe-table-plugin-element/index.ts b/node_modules/vxe-table-plugin-element/index.ts
index d59d00f..ff8ba8c 100644
--- a/node_modules/vxe-table-plugin-element/index.ts
+++ b/node_modules/vxe-table-plugin-element/index.ts
@@ -331,7 +331,7 @@ function getFormItemProps ({ $form }: any, { props }: any, defaultProps?: any) {
 }
 
 function getFormEvents (renderOpts: any, params: any) {
-  let { events }: any = renderOpts
+  let { name, events }: any = renderOpts
   let { $form }: any = params
   let type: string = 'change'
   switch (name) {
@@ -737,8 +737,11 @@ function handleClearEvent (params: any, evnt: any, context:any) {
 export const VXETablePluginElement = {
   install (xtable: typeof VXETable) {
     let { interceptor, renderer } = xtable
+    // @ts-ignore
     renderer.mixin(renderMap)
+    // @ts-ignore
     interceptor.add('event.clearFilter', handleClearEvent)
+    // @ts-ignore
     interceptor.add('event.clearActived', handleClearEvent)
   }
 }

This issue body was partially generated by patch-package.

编辑表格 二级联动引用ElSelect的问题

1.我这边的场景是编辑表格,下拉框二级联动多行切换显示问题。

库位根据选择的仓库动态加载,让我第二行数据的时候,第一行的库位就没办法正常显示lable了,而直接显示了id,因为ELSelect的options变了,不知道什么原因引起的?
Uploading image.png…

能否支持自定义组件

项目中会因业务需求对某些组件进行二次封装,比如说对于 el-input 组件二次封装,能否使该组件能够作为 filterRender 进行配置渲染,filterRender: { name: 'SelfDefineComp', props: { some properties } }

找不到xe-utils依赖

`This dependency was not found:

  • xe-utils/methods/xe-utils in ./node_modules/vxe-table-plugin-element/dist/index.common.js, ./node_modules/vxe-table/lib/vxe-table.js and 29 others

To install it, you can run: npm install --save xe-utils/methods/xe-utils`

请问支持vxe grid功能吗?

(必填)这个需求解决了什么问题:
请问支持vxe grid功能吗?需要后端传送有哪些列,请问有相关的demo吗?

希望ElDatePicker 添加type=monthrange

这个新特性和一个问题相关吗?简单描述下,比如我什么场景下,需要解决什么问题,发现表格不支持这个功能 Is your feature request related to a problem? Please describe.

year/month/date/dates/ week/datetime/datetimerange/ daterange/monthrange

就差monthrange了

描述下,你希望得到的什么解决方案 Describe the solution you'd like

是否有不错的替代方案 Describe alternatives you've considered

Uncaught TypeError: Cannot read properties of undefined (reading 'mixin')

vue 2.6 + element-ui 2.15.6 应该使用哪个版本?

导入 vxe-table 时 正常运行, 导入 vxe-table-plugin-element 后报错

image

我的 package.json
image

// src/plugins/vxe-table.js
import Vue from 'vue'

import 'xe-utils'
import VXETable from 'vxe-table'
import VXETablePluginElement from 'vxe-table-plugin-element'
import 'vxe-table-plugin-element/dist/style.css'

// 使用 VXETable
Vue.use(VXETable)
// 使用 VXETablePluginElement
Vue.use(VXETablePluginElement)

我应该下载哪个版本的 vxe-table-plugin-element,翻阅文档后,暂未找到相关说明,谢谢

请问vue3如何使用?

这个需求解决了什么问题:

// ...
import VXETable from 'vxe-table'
import VXETablePluginElement from 'vxe-table-plugin-element'
import 'vxe-table-plugin-element/dist/style.css'
// ...

VXETable.use(VXETablePluginElement)

我在main.ts使用了此方法, 但是没有标签并没有渲染处理,是不是好些了什么?

建议的 API 是什么样的:

No response

是否已有其他不错的替代方案:

No response

升级到Vue3?

这个需求解决了什么问题:

目前主版本已经升级到vue3了,整个vxe-table在vue3中的表现依然完美,但随着第三方组件的升级,目前此插件的版本是稍微略低的,例如,Element-UI-Plus已经发布了,不仅改版为了Vue3的写法,同时添加了多个组件,例如 ElTreeSelect等,希望能够得到更多的支持,谢谢

建议的 API 是什么样的:

希望依然能够开箱即用

是否已有其他不错的替代方案:

使用1.8.1版,并且用的是typescript时报错

报错信息如下:

                       nuxt:typescript 07:08:01e/trunk/9.src/vue-template/node_modules/vxe-table-plugin-element/index.ts(11,3):
11:3 Module '"../vxe-table/lib/vxe-table"' has no exported member 'ColumnFilterParams'. Did you mean to use 'import ColumnFilterParams from "../vxe-table/lib/vxe-table"' instead?
     9 |   InterceptorParams,
    10 |   TableRenderParams,
  > 11 |   ColumnFilterParams,
       |   ^
    12 |   ColumnFilterRenderOptions,
    13 |   ColumnCellRenderOptions,
    14 |   ColumnEditRenderOptions,

应该是ColumnFilterParams没定义的原因?

体验问题

表格筛选时,下拉选择是多选的情况下会遮住筛选和重置按钮,这样体验不好
54
不知作者您有什么好的解决方案?
能否在筛选时加个回车事件,直接进行筛序?这样体验更加友好,我们现在做的项目用户普遍反映这个问题

filter-render 兼容el-radio组件吗?

可复现的链接:

1

问题描述与截图:

组件在里面失效

期望的结果:

喜欢能够兼容element el-radio和el-radio-group组件

操作系统:

win11

浏览器版本:

chrome

vue 版本:

3.4.0

vxe-table 版本:

4.5.22

xe-utils依赖找不到

`This dependency was not found:

  • xe-utils/methods/xe-utils in ./node_modules/vxe-table-plugin-element/dist/index.common.js, ./node_modules/vxe-table/lib/vxe-table.js and 29 others

To install it, you can run: npm install --save xe-utils/methods/xe-utils`

使用yarn安装运行,提示找不到dayjs

可复现的链接:

问题描述与截图:

有的项目本身没有安装dayjs,而vxe-table-plugin-element依赖与dayjs,就提示找不到,建议把dayjs作为dependencies依赖项。

期望的结果:

把dayjs放到dependencies中

操作系统:

win11

浏览器版本:

chrome116

vue 版本:

2.6.0

vxe-table 版本:

3.7.0-beta.20

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.