vxe-table vue 表格禁用单元格编辑的2种实现方式
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
来源:程序园用户自行投稿发布,如果侵权,请联系站长删除
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!
页:
[1]