2.8.0 • Published 5 years ago

watermarker-icx v2.8.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

使用

参见

前端水印生成方案

  • simple tool to create water maker
  • @param container
  • @param width: canvas 宽
  • @param height: canvas 高
  • @param textAlign: 文本对齐方式
  • @param textBaseline
  • @param font: 字体设置
  • @param fillStyle: 填充颜色
  • @param content: 文本内容
  • @param rotate: 旋转角度
  • @param zIndex: 层级

安装

npm install --save watermarker-icx

使用

默认情况下,仅依赖document.body,可以灵活在入口处调用。

  1. 独立版本使用

引入独立版本

<script src='path/to/watermarker-standalone.js'></script>

调用使用

// pure javascript
document.addEventListener("DOMContentLoaded", function() {
	createMarker();
});

// jQuery
$(document).ready(function() {
	createMarker();
});
  1. 模块环境使用

以 React 项目为例:

import createMarker from watermarker-icx;

componentDidMount() {
	createMarker();
}
  1. roadhog build 报错问题解决
env: {
	# 新增配置
	production: {
		extraBabelIncludes: ['node_modules/watermarker-icx'],
	},
}

roadhog issues 664

2.8.0

5 years ago

2.7.0

5 years ago

2.6.0

5 years ago

2.5.0

5 years ago

2.4.0

5 years ago

2.3.0

5 years ago

2.2.0

5 years ago

2.1.0

5 years ago

2.0.0

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago