feat: 添加防抖节流指令并规范自定义指令用法错误时的提示

This commit is contained in:
xiaoxian521
2023-06-12 13:53:54 +08:00
parent c06ce94746
commit d850496601
3 changed files with 59 additions and 1 deletions

View File

@@ -7,7 +7,9 @@ export const auth: Directive = {
if (value) {
!hasAuth(value) && el.parentNode?.removeChild(el);
} else {
throw new Error("need auths! Like v-auth=\"['btn.add','btn.edit']\"");
throw new Error(
"[Directive: auth]: need auths! Like v-auth=\"['btn.add','btn.edit']\""
);
}
}
};