Skip to content

Commit

Permalink
Issue kciter#24: fix the make() API introduction
Browse files Browse the repository at this point in the history
  • Loading branch information
harrisoff committed Oct 17, 2018
1 parent 8f9e1e6 commit e93ca41
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,23 @@ or clone this repository and copy `qart.min.js` to your project.
```html
<script src="../dist/qart.min.js"></script>
<script>
var qart = new QArt({
// directly appending canvas to the document
new QArt({
value: value,
imagePath: './example.png',
filter: filter,
size: 195
}).make();
document.getElementById('qart').appendChild(qart);
}).make(document.getElementById('qart'));
// using callback
new QArt({
value: value,
imagePath: './example.png',
filter: filter,
size: 195
}).make(function (canvas) {
document.getElementById('qart').appendChild(canvas)
});
</script>
```

Expand All @@ -50,7 +60,14 @@ const qart = new QArt({
filter: filter,
size: 195
});
document.getElementById('qart').appendChild(qart.make());

// directly appending canvas to the document
qart.make(document.getElementById('qart'))

// using callback
qart.make((canvas) => {
document.getElementById('qart').appendChild(canvas);
});
```

### With React
Expand Down

0 comments on commit e93ca41

Please sign in to comment.