diff --git a/src/App.vue b/src/App.vue index cc474ac..babd389 100644 --- a/src/App.vue +++ b/src/App.vue @@ -4,7 +4,7 @@
- +
@@ -24,9 +24,6 @@ }, guideSize: function (size) { this.$refs.canvas.slice = size - }, - updateImageSize: function (size) { - this.$refs.sidebar.imageSize = size } } } diff --git a/src/components/Canvas.vue b/src/components/Canvas.vue index 26f66f1..6752af5 100644 --- a/src/components/Canvas.vue +++ b/src/components/Canvas.vue @@ -1,6 +1,6 @@ @@ -36,7 +36,7 @@ this.image = new Image() this.image.onload = () => { this.imageLoaded = true - this.$emit('imageLoaded', [this.image.width, this.image.height]) + this.$bus.$emit('imageLoaded', this.image) this.refresh() } this.image.src = imageUrl @@ -44,7 +44,7 @@ refresh: function () { if (!this.imageLoaded) return let image = this.image - let canvas = document.getElementById('canvas') + let canvas = this.$refs.canvas let ctx = canvas.getContext('2d') ctx.clearRect(0, 0, canvas.width, canvas.height) diff --git a/src/components/Player.vue b/src/components/Player.vue new file mode 100644 index 0000000..bc739f6 --- /dev/null +++ b/src/components/Player.vue @@ -0,0 +1,65 @@ + + + + + diff --git a/src/components/Sidebar.vue b/src/components/Sidebar.vue index 9cb2997..416f0d0 100644 --- a/src/components/Sidebar.vue +++ b/src/components/Sidebar.vue @@ -41,18 +41,24 @@
+