mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-10-15 20:18:49 +08:00
refactor: 代码规范
This commit is contained in:
parent
991217ba8b
commit
3867675cf1
@ -54,6 +54,7 @@ destroyWatermark(); // 销毁水印
|
|||||||
默认参数是:
|
默认参数是:
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
|
content = '请勿外传',
|
||||||
container = document.body,
|
container = document.body,
|
||||||
width = 300,
|
width = 300,
|
||||||
height = 300,
|
height = 300,
|
||||||
@ -62,7 +63,6 @@ destroyWatermark(); // 销毁水印
|
|||||||
fontSize = '14px',
|
fontSize = '14px',
|
||||||
fontFamily = 'Microsoft Yahei',
|
fontFamily = 'Microsoft Yahei',
|
||||||
fillStyle = 'rgba(184, 184, 184, 0.3)',
|
fillStyle = 'rgba(184, 184, 184, 0.3)',
|
||||||
content = '请勿外传',
|
|
||||||
rotate = 25,
|
rotate = 25,
|
||||||
zIndex = 99999,
|
zIndex = 99999,
|
||||||
timestamp = 'YYYY-MM-DD HH:mm'
|
timestamp = 'YYYY-MM-DD HH:mm'
|
||||||
|
@ -35,6 +35,7 @@ let _wmTimer = null; // timestamp
|
|||||||
|
|
||||||
function _createWatermark(param) {
|
function _createWatermark(param) {
|
||||||
const {
|
const {
|
||||||
|
content,
|
||||||
container,
|
container,
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
@ -43,7 +44,6 @@ function _createWatermark(param) {
|
|||||||
fontSize,
|
fontSize,
|
||||||
fontFamily,
|
fontFamily,
|
||||||
fillStyle,
|
fillStyle,
|
||||||
content,
|
|
||||||
rotate,
|
rotate,
|
||||||
zIndex,
|
zIndex,
|
||||||
timestamp
|
timestamp
|
||||||
@ -140,6 +140,7 @@ export function destroyWatermark() {
|
|||||||
|
|
||||||
// canvas 实现 watermark
|
// canvas 实现 watermark
|
||||||
export function createWatermark({
|
export function createWatermark({
|
||||||
|
content = '请勿外传',
|
||||||
container = document.body,
|
container = document.body,
|
||||||
width = 300,
|
width = 300,
|
||||||
height = 300,
|
height = 300,
|
||||||
@ -148,7 +149,6 @@ export function createWatermark({
|
|||||||
fontSize = '14px',
|
fontSize = '14px',
|
||||||
fontFamily = 'Microsoft Yahei',
|
fontFamily = 'Microsoft Yahei',
|
||||||
fillStyle = 'rgba(184, 184, 184, 0.3)',
|
fillStyle = 'rgba(184, 184, 184, 0.3)',
|
||||||
content = '请勿外传',
|
|
||||||
rotate = 25,
|
rotate = 25,
|
||||||
zIndex = 99999,
|
zIndex = 99999,
|
||||||
timestamp = 'YYYY-MM-DD HH:mm'
|
timestamp = 'YYYY-MM-DD HH:mm'
|
||||||
@ -162,6 +162,7 @@ export function createWatermark({
|
|||||||
destroyWatermark();
|
destroyWatermark();
|
||||||
|
|
||||||
_createWatermark({
|
_createWatermark({
|
||||||
|
content,
|
||||||
container,
|
container,
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
@ -170,7 +171,6 @@ export function createWatermark({
|
|||||||
fontSize,
|
fontSize,
|
||||||
fontFamily,
|
fontFamily,
|
||||||
fillStyle,
|
fillStyle,
|
||||||
content,
|
|
||||||
rotate,
|
rotate,
|
||||||
zIndex,
|
zIndex,
|
||||||
timestamp
|
timestamp
|
||||||
|
Loading…
x
Reference in New Issue
Block a user