Updated examples

This commit is contained in:
euvl
2017-03-10 11:05:33 +00:00
parent c1913b0490
commit 0a46692303
3 changed files with 57 additions and 53 deletions

View File

@@ -3,7 +3,6 @@
</div>
</template>
<script>
import util from '../util';
export default {
name: 'Resizer',
data() {
@@ -26,7 +25,7 @@ export default {
window.addEventListener('mousemove', this.mousemove, false);
window.addEventListener('mouseup', this.stop, false);
util.stopEvent(event);
event.stopPropagation();
},
stop() {
this.clicked = false;
@@ -54,10 +53,15 @@ export default {
var height = event.clientY - el.offsetTop;
if (height < this.min.height) {
return;
height = this.min.height;
}
if (width < this.min.width) {
width = this.min.width;
}
this.size = {width, height};
el.style.width = width + 'px';
el.style.height = height + 'px';