File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,22 +20,6 @@ const app = getCurrentInstance();
2020let childElementWatermark = null
2121
2222onMounted (() => {
23- // 富文本水印
24- richTextWatermark = new Watermark ({
25- contentType: ' rich-text' ,
26- content: ' <div style="background: #ccc;">富文本水印 <span style="color: #f00">good</span></div>' ,
27- width: 300 ,
28- height: 300 ,
29- filter: ' blur(2px)' ,
30- movable: true ,
31- onSuccess : () => {
32- app .appContext .config .globalProperties .$message ({
33- appendTo: ' #app' ,
34- message: ' 富文本水印添加成功!' ,
35- type: ' success'
36- });
37- }
38- });
3923 // 子元素水印
4024 childElementWatermark = new Watermark ({
4125 parent: ' .parent-element' ,
@@ -342,7 +326,10 @@ watermark.create() // 添加水印
342326
343327watermark .destroy () // 删除水印
344328```
345- <div class =" parent-element " style =" width : 400px ;height : 400px ;border : 1px solid #333 ;margin-top : 10px ;position : relative ;" >
329+ <div class =" parent-element " style =" border : 1px solid #333 ;width : 400px ;height : 400px ;margin-top : 10px ;position : relative ;overflow : hidden ;" >
330+ <div class =" scroll-list " style =" overflow : auto ;width : 400px ;height : 400px ;" >
331+ <div v-for="(item, index) in Array.from({length: 100})">{{index + 1}}</div>
332+ </div >
346333</div >
347334<el-affix target =" .child-element-watermark " position =" bottom " :offset =" 0 " z-index =" 1000 " >
348335 <el-space class =" block-operation " >
You can’t perform that action at this time.
0 commit comments