From d582f081e148c5df7c1b334a94fa1df1cd2655a9 Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期四, 04 七月 2024 22:40:20 +0800
Subject: [PATCH] 班制更新

---
 src/views/demo/feat/watermark/index.vue |   48 ++++++++++++++++++++++++++++--------------------
 1 files changed, 28 insertions(+), 20 deletions(-)

diff --git a/src/views/demo/feat/watermark/index.vue b/src/views/demo/feat/watermark/index.vue
index a8a22d2..e68cbbd 100644
--- a/src/views/demo/feat/watermark/index.vue
+++ b/src/views/demo/feat/watermark/index.vue
@@ -1,32 +1,40 @@
 <template>
   <PageWrapper title="姘村嵃绀轰緥">
     <CollapseContainer class="w-full h-32 bg-white rounded-md" title="Global WaterMark">
-      <a-button type="primary" class="mr-2" @click="setWatermark('WaterMark Info')">
-        Create
+      <a-button type="primary" class="mr-2" @click="setWatermark('WaterMark Info1')">
+        Create Watermark1
       </a-button>
-      <a-button color="error" class="mr-2" @click="clear"> Clear </a-button>
+      <a-button type="primary" class="mr-2" @click="setWatermark2('WaterMark Info2')">
+        Create Watermark2
+      </a-button>
+      <a-button type="primary" class="mr-2" @click="setWatermark3('Custome Style WaterMark')">
+        Create custom style Watermark
+      </a-button>
+      <a-button color="error" class="mr-2" @click="clear"> Clear Watermark1 </a-button>
+      <a-button color="error" class="mr-2" @click="clearAll"> ClearAll </a-button>
       <a-button color="warning" class="mr-2" @click="setWatermark('WaterMark Info New')">
-        Reset
+        Update Watermark1
       </a-button>
     </CollapseContainer>
   </PageWrapper>
 </template>
-<script lang="ts">
-  import { defineComponent, ref } from 'vue';
-  import { CollapseContainer } from '/@/components/Container/index';
-  import { useWatermark } from '/@/hooks/web/useWatermark';
-  import { PageWrapper } from '/@/components/Page';
+<script lang="ts" setup>
+  import { onUnmounted, ref } from 'vue';
+  import { CollapseContainer } from '@/components/Container';
+  import { useWatermark } from '@/hooks/web/useWatermark';
+  import { PageWrapper } from '@/components/Page';
 
-  export default defineComponent({
-    components: { CollapseContainer, PageWrapper },
-    setup() {
-      const areaRef = ref<Nullable<HTMLElement>>(null);
-      const { setWatermark, clear } = useWatermark();
-      return {
-        setWatermark,
-        clear,
-        areaRef,
-      };
-    },
+  const app = ref(document.body);
+
+  const { setWatermark, clear, clearAll } = useWatermark();
+  const { setWatermark: setWatermark2 } = useWatermark();
+  const { setWatermark: setWatermark3 } = useWatermark(app, {
+    fontColor: 'red',
+    fontSize: 12,
+    rotate: 30,
+  });
+
+  onUnmounted(() => {
+    clearAll();
   });
 </script>

--
Gitblit v1.9.3