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'"> <template v-else-if="typeof item === 'object'">
<el-button <el-button
v-if="item.render === undefined || item.render(scope.row)" 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" :icon="item.icon"
:type="item.type ?? 'primary'" :type="item.type ?? 'primary'"
size="small" size="small"

View File

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

View File

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