chore: v-access类型标注

This commit is contained in:
dap 2024-10-11 20:58:59 +08:00
parent c5fcf50c76
commit 1a6e5d22fd
2 changed files with 15 additions and 1 deletions

View File

@ -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"
}

12
apps/web-antd/types/directive.d.ts vendored Normal file
View File

@ -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<Element, string | string[]>;
}
}