diff --git a/.vscode/settings.json b/.vscode/settings.json index 0cbfa452..ece7b1f2 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -222,5 +222,7 @@ "vitest.disableWorkspaceWarning": true, "cSpell.words": ["tinymce"], "typescript.tsdk": "node_modules/typescript/lib", - "editor.linkedEditing": true // 自动同步更改html标签 + "editor.linkedEditing": true, // 自动同步更改html标签, + "vscodeCustomCodeColor.highlightValue": "v-access", // v-access显示的颜色 + "vscodeCustomCodeColor.highlightValueColor": "#CCFFFF" } diff --git a/apps/web-antd/types/directive.d.ts b/apps/web-antd/types/directive.d.ts new file mode 100644 index 00000000..c2a6ff76 --- /dev/null +++ b/apps/web-antd/types/directive.d.ts @@ -0,0 +1,12 @@ +import type { Directive } from 'vue'; + +declare module 'vue' { + export interface ComponentCustomProperties { + /** + * 判断权限: v-access:code="" + * 判断角色 v-access:role="" + * TODO: 泛型第四个函数为code或role 不生效 + */ + vAccess: Directive; + } +}