From 3867675cf1fe43d0adba4c659e1f2554edec5881 Mon Sep 17 00:00:00 2001 From: ocean-gao Date: Tue, 10 May 2022 17:16:37 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BB=A3=E7=A0=81=E8=A7=84?= =?UTF-8?q?=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/reference/plugin/plugins/watermark.md | 2 +- packages/fes-plugin-watermark/src/runtime/core.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/reference/plugin/plugins/watermark.md b/docs/reference/plugin/plugins/watermark.md index 0d22f565..5708c11e 100644 --- a/docs/reference/plugin/plugins/watermark.md +++ b/docs/reference/plugin/plugins/watermark.md @@ -54,6 +54,7 @@ destroyWatermark(); // 销毁水印 默认参数是: ```js { + content = '请勿外传', container = document.body, width = 300, height = 300, @@ -62,7 +63,6 @@ destroyWatermark(); // 销毁水印 fontSize = '14px', fontFamily = 'Microsoft Yahei', fillStyle = 'rgba(184, 184, 184, 0.3)', - content = '请勿外传', rotate = 25, zIndex = 99999, timestamp = 'YYYY-MM-DD HH:mm' diff --git a/packages/fes-plugin-watermark/src/runtime/core.js b/packages/fes-plugin-watermark/src/runtime/core.js index 87381690..dbe13e26 100644 --- a/packages/fes-plugin-watermark/src/runtime/core.js +++ b/packages/fes-plugin-watermark/src/runtime/core.js @@ -35,6 +35,7 @@ let _wmTimer = null; // timestamp function _createWatermark(param) { const { + content, container, width, height, @@ -43,7 +44,6 @@ function _createWatermark(param) { fontSize, fontFamily, fillStyle, - content, rotate, zIndex, timestamp @@ -140,6 +140,7 @@ export function destroyWatermark() { // canvas 实现 watermark export function createWatermark({ + content = '请勿外传', container = document.body, width = 300, height = 300, @@ -148,7 +149,6 @@ export function createWatermark({ fontSize = '14px', fontFamily = 'Microsoft Yahei', fillStyle = 'rgba(184, 184, 184, 0.3)', - content = '请勿外传', rotate = 25, zIndex = 99999, timestamp = 'YYYY-MM-DD HH:mm' @@ -162,6 +162,7 @@ export function createWatermark({ destroyWatermark(); _createWatermark({ + content, container, width, height, @@ -170,7 +171,6 @@ export function createWatermark({ fontSize, fontFamily, fillStyle, - content, rotate, zIndex, timestamp