Files
certd/packages/ui/certd-client/src/components/vip-button/directive.ts
T

22 lines
622 B
TypeScript
Raw Normal View History

2025-04-12 23:59:03 +08:00
import { useSettingStore } from "/@/store/settings";
2024-10-05 01:46:25 +08:00
2024-09-05 14:33:45 +08:00
export default {
mounted(el: any, binding: any, vnode: any) {
const { value } = binding;
2024-10-05 01:46:25 +08:00
const settingStore = useSettingStore();
2024-09-05 14:33:45 +08:00
el.className = el.className + " need-plus";
2024-10-05 01:46:25 +08:00
if (!settingStore.isPlus) {
2024-09-05 14:33:45 +08:00
el.addEventListener("click", function (event: any) {
event.stopPropagation();
event.preventDefault();
settingStore.checkPlus();
2024-09-05 14:33:45 +08:00
});
el.addEventListener("move", function (event: any) {
event.stopPropagation();
event.preventDefault();
settingStore.checkPlus();
2024-09-05 14:33:45 +08:00
});
}
2025-06-29 14:09:09 +08:00
},
2024-09-05 14:33:45 +08:00
};