We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://stackblitz.com/edit/vitejs-vite-4qxkf8sd?file=src%2Fviews%2FDemo1.vue
再同时使用slots和formatter的时候,formatter不会生效 代码
slots
formatter
<script lang="ts" setup> import { reactive } from 'vue'; import type { VxeGridProps } from 'vxe-table'; import { VxeUI } from 'vxe-pc-ui'; interface RowVO { id: number; name: string; role: string; flag1: boolean; flag2: number; } VxeUI.formats.add('formatGroupLock1', { cellFormatMethod({ cellValue }) { return cellValue !== 1; }, }); const gridOptions = reactive<VxeGridProps<RowVO>>({ border: true, showOverflow: true, columns: [ { type: 'seq', width: 70 }, { field: 'name', title: 'Name', minWidth: 200 }, { field: 'flag1', title: '开关', width: 120, slots: { default: 'flag1_default' }, }, { field: 'flag2', title: '可编辑', width: 120, slots: { default: 'flag2_default' }, formatter: 'formatGroupLock1', }, ], data: [ { id: 10001, name: 'Test1', role: 'Develop', flag1: false, flag2: 2 }, { id: 10002, name: 'Test2', role: 'Test', flag1: true, flag2: 2 }, { id: 10003, name: 'Test3', role: 'PM', flag1: false, flag2: 1 }, ], }); </script> <template> <div> <vxe-grid v-bind="gridOptions"> <template #flag1_default="{ row }"> <vxe-switch v-model="row.flag1" disabled></vxe-switch> </template> <template #flag2_default="{ row }"> <vxe-switch v-model="row.flag2"></vxe-switch> </template> </vxe-grid> </div> </template>
实际效果:
在这个例子中,flag2数据为数字,但是通过formatter将数字转成了boolean类型,应用vxe-switch后,结果未如预期被正确渲染
flag2
boolean
期望效果为:
No response
ubnutu22.04
Chrome 130.0.6723.69
3.5.13
4.3.27
4.9.16
The text was updated successfully, but these errors were encountered:
No branches or pull requests
可复现的链接(必须为公开链接,仅包含能复现问题的示例代码):
https://stackblitz.com/edit/vitejs-vite-4qxkf8sd?file=src%2Fviews%2FDemo1.vue
问题描述与截图:
再同时使用
slots
和formatter
的时候,formatter不会生效代码
实际效果:
在这个例子中,
flag2
数据为数字,但是通过formatter
将数字转成了boolean
类型,应用vxe-switch后,结果未如预期被正确渲染期望效果为:
期望的结果:
No response
操作系统:
ubnutu22.04
浏览器版本:
Chrome 130.0.6723.69
vue 版本:
3.5.13
vxe-pc-ui 版本:
4.3.27
vxe-table 版本:
4.9.16
是否使用当前最新版本?
The text was updated successfully, but these errors were encountered: