登录
/
注册
首页
论坛
其它
首页
科技
业界
安全
程序
广播
Follow
关于
博客
发1篇日志+1圆
记录
发1条记录+2圆币
发帖说明
VIP申请
登录
/
注册
账号
自动登录
找回密码
密码
登录
立即注册
搜索
搜索
关闭
CSDN热搜
程序园
精品问答
技术交流
资源下载
本版
帖子
用户
软件
问答
教程
代码
VIP申请
VIP网盘
网盘
联系我们
道具
勋章
任务
设置
我的收藏
退出
腾讯QQ
微信登录
返回列表
首页
›
资源区
›
代码
›
vxe-table vue 表格禁用单元格编辑的2种实现方式 ...
vxe-table vue 表格禁用单元格编辑的2种实现方式
[ 复制链接 ]
公西颖初
2025-6-25 09:31:03
vxe-table vue 表格禁用单元格编辑的2种实现方式
查看官网:https://vxetable.cn
gitbub:https://github.com/x-extends/vxe-table
gitee:https://gitee.com/x-extends/vxe-table
阻止激活编辑
设置 edit-config 的 beforeEditMethod 方法判断单元格是否禁用,例如:限制第二行不允许编辑
<template>
<vxe-grid v-bind="gridOptions" v-on="gridEvents">
<template #edit_name="{ row }">
<vxe-input v-model="row.name"></vxe-input>
</template>
<template #edit_sex="{ row }">
<vxe-input v-model="row.name"></vxe-input>
</template>
<template #edit_age="{ row }">
<vxe-input v-model="row.name"></vxe-input>
</template>
<template #edit_address="{ row }">
<vxe-input v-model="row.name"></vxe-input>
</template>
</vxe-grid>
</template>
复制代码
禁用编辑控件
通过 disabled 方式禁用控件,实现行编辑中对列的权限控制
<template>
<vxe-grid v-bind="gridOptions" v-on="gridEvents">
<template #edit_name="{ row }">
<vxe-input v-model="row.name"></vxe-input>
</template>
<template #edit_sex="{ row }">
<vxe-input v-model="row.name"></vxe-input>
</template>
<template #edit_age="{ row }">
<vxe-input v-model="row.name"></vxe-input>
</template>
<template #edit_address="{ row }">
<vxe-input v-model="row.name"></vxe-input>
</template>
</vxe-grid>
</template>
复制代码
https://gitee.com/x-extends/vxe-table
来源:程序园用户自行投稿发布,如果侵权,请联系站长删除
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!
vxe
table
vue
表格
禁用
相关帖子
记录---vue3打印解决方案:Vue-Plugin-HiPrint
vue 如何使用 vxe-table 来实现跨表拖拽,多表联动互相拖拽数据
vue table 甘特图 vxe-gantt 实现多个表格的任务互相拖拽数据
如何使用 vxe-table 实现穿梭框的功能,同时还能支持数据拖拽穿梭
vxe-table 单元格超出隐藏内容提示使用自定义插槽模板
vip免费申请,1年只需15美金$
回复
使用道具
举报
提升卡
置顶卡
沉默卡
喧嚣卡
变色卡
千斤顶
照妖镜
相关推荐
安全
记录---vue3打印解决方案:Vue-Plugin-HiPrint
0
613
姨番单
2025-08-26
代码
vue 如何使用 vxe-table 来实现跨表拖拽,多表联动互相拖拽数据
0
259
亢安芙
2025-08-27
代码
vue table 甘特图 vxe-gantt 实现多个表格的任务互相拖拽数据
0
1017
孔季雅
2025-08-28
代码
如何使用 vxe-table 实现穿梭框的功能,同时还能支持数据拖拽穿梭
0
808
丰江
2025-09-02
代码
vxe-table 单元格超出隐藏内容提示使用自定义插槽模板
0
358
驼娑
2025-09-05
高级模式
B
Color
Image
Link
Quote
Code
Smilies
您需要登录后才可以回帖
登录
|
立即注册
回复
本版积分规则
回帖并转播
回帖后跳转到最后一页
签约作者
程序园优秀签约作者
发帖
公西颖初
2025-6-25 09:31:03
关注
0
粉丝关注
28
主题发布
板块介绍填写区域,请于后台编辑
财富榜{圆}
敖可
9984
黎瑞芝
9990
杭环
9988
4
凶契帽
9988
5
氛疵
9988
6
猷咎
9986
7
里豳朝
9986
8
肿圬后
9986
9
蝓俟佐
9984
10
虽裘侪
9984
查看更多