Created
December 6, 2016 18:41
-
-
Save dasDaniel/ea2a27e51cbd22e34f81d8094748611f to your computer and use it in GitHub Desktop.
LbmpMY
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="demo" class="demo"> | |
<button v-on:click="add">Add</button> | |
<canvas id="assetcanvas" width="200" height="200"></canvas> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new Vue({ | |
el: '#demo', | |
methods: { | |
add: function () { | |
var path = new paper.Path(); | |
path.strokeColor = 'red'; | |
path.moveTo(new paper.Point(Math.random()*200, Math.random()*200)); | |
path.lineTo(new paper.Point(Math.random()*200, Math.random()*200)); | |
paper.view.draw() | |
}, | |
} | |
}) | |
paper.install(window) | |
paper.setup(document.getElementById('assetcanvas')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://cdnjs.cloudflare.com/ajax/libs/paper.js/0.10.2/paper-core.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.1.4/vue.min.js"></script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment