From 86c30ab5d8fa74bf77bdd75d8008a6d87dab28b6 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 26 九月 2025 16:00:07 +0800
Subject: [PATCH] 打包修改
---
src/directive/common/full.ts | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 50 insertions(+), 0 deletions(-)
diff --git a/src/directive/common/full.ts b/src/directive/common/full.ts
new file mode 100644
index 0000000..45378dd
--- /dev/null
+++ b/src/directive/common/full.ts
@@ -0,0 +1,50 @@
+import type { Directive } from "vue";
+interface ElType extends HTMLElement {
+ $oldStyle: CSSStyleDeclaration;
+ $fullStyle: CSSStyleDeclaration;
+}
+const vFull: Directive = {
+ mounted: (el: ElType, binding) => {
+ el.$oldStyle = { ...el.style }
+ if (binding.arg === 'screen') {
+ el.$fullStyle = {
+ ...el.style,
+ left: '0',
+ top: '0',
+ zIndex: '8',
+ position: 'fixed',
+ height: '100vh',
+ width: '100vw',
+ }
+ } else {
+ el.$fullStyle = {
+ ...el.style,
+ left: '0',
+ top: '0',
+ zIndex: '8',
+ position: 'absolute',
+ height: '100%',
+ width: '100%',
+ }
+ }
+
+ },
+ updated: (el: ElType, binding) => {
+ function setStyle(el: CSSStyleDeclaration, style: CSSStyleDeclaration) {
+ el.position = style.position
+ el.left = style.left
+ el.top = style.top
+ el.zIndex = style.zIndex
+ el.height = style.height
+ el.width = style.width
+ }
+ if (binding.value) {
+ setStyle(el.style, el.$fullStyle)
+ } else {
+ setStyle(el.style, el.$oldStyle)
+ }
+ }
+}
+export default vFull
+
+
--
Gitblit v1.9.3