-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathindex.js
30 lines (28 loc) · 1002 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/**
* @file: e2e入口文件
* @author: zhw
* @Date: 2021-01-09 13:34:21
* @Last Modified by: zhw
* @Last Modified time: 2021-05-31 22:08:08
*/
import san from 'san';
import {mixImg} from '../../src/index';
import {canvasConfig, base64Config} from '../config/allConfig';
const App = san.defineComponent({
template: ` <div class="wrap">
<div>合成图片测试</div>
<div class="mi-btn" on-click="getImg">合成图片</div>
<div id="show-img-wrap"></div>
<div id="font-load-one">.</div>
<div id="font-load-two">.</div>
</div>`,
async getImg() {
const res = await mixImg(canvasConfig);
// 返回了canvas则置入页面
if (res.errno === 0 && res.data.canvas) {
document.getElementById('show-img-wrap').appendChild(res.data.canvas);
}
console.log('图片合成结束~~', res);
}
});
new App().attach(document.body);