refactor: ♻️ cURD组件额外的操作列可以不需要auth属性

CURD组件额外的操作列可以不需要auth属性
This commit is contained in:
胡少翔
2024-11-27 17:53:51 +08:00
parent 239781788e
commit 64a6adad96
3 changed files with 4 additions and 3 deletions

View File

@@ -284,7 +284,9 @@
<template v-else-if="typeof item === 'object'">
<el-button
v-if="item.render === undefined || item.render(scope.row)"
v-hasPerm="[`${contentConfig.pageName}:${item.auth}`]"
v-bind="
item.auth ? { 'v-hasPerm': [`${contentConfig.pageName}:${item.auth}`] } : {}
"
:icon="item.icon"
:type="item.type ?? 'primary'"
size="small"

View File

@@ -174,7 +174,7 @@ export interface IContentConfig<T = any> {
| "edit"
| "delete"
| {
auth: string;
auth?: string;
icon?: string;
name: string;
text: string;

View File

@@ -105,7 +105,6 @@ const contentConfig: IContentConfig<UserPageQuery> = {
templet: "tool",
operat: [
{
auth: "password:reset",
icon: "Document",
name: "detail",
text: "详情",