2020-08-13 11:47:56 +08:00
|
|
|
<template>
|
|
|
|
<article>
|
|
|
|
<div
|
|
|
|
ref="target1"
|
|
|
|
v-drag:target1.translate.x
|
|
|
|
class="target"
|
|
|
|
>
|
|
|
|
水平方向
|
|
|
|
</div>
|
|
|
|
<div
|
|
|
|
ref="target2"
|
|
|
|
v-drag:target2.translate.y
|
|
|
|
class="target"
|
|
|
|
>
|
|
|
|
垂直方向
|
|
|
|
</div>
|
|
|
|
</article>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import drag from 'veui/directives/drag'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
directives: {
|
|
|
|
drag
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2021-09-15 20:03:51 +08:00
|
|
|
<style lang="less" scoped>
|
2020-08-13 11:47:56 +08:00
|
|
|
article {
|
|
|
|
height: 200px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.target {
|
2021-09-15 20:03:51 +08:00
|
|
|
width: 80px;
|
|
|
|
height: 80px;
|
|
|
|
background: #e7e7e7;
|
2020-08-13 11:47:56 +08:00
|
|
|
display: inline-flex;
|
|
|
|
margin-right: 40px;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
vertical-align: top;
|
|
|
|
}
|
|
|
|
|
|
|
|
.container {
|
2021-09-15 20:03:51 +08:00
|
|
|
width: 100%;
|
|
|
|
height: 300px;
|
|
|
|
background: #f7f7f7;
|
2020-08-13 11:47:56 +08:00
|
|
|
}
|
|
|
|
</style>
|