<template>
  <view class="freedrag-item" :style="posStyle">
    <slot></slot>
  </view>
</template>

<script>
import props from './prop.js'

export default {
  // #ifdef MP-WEIXIN
  // 将自定义节点设置成虚拟的，更加接近Vue组件的表现，能更好的使用flex属性
  options: {
      virtualHost: true
  },
  // #endif
  name: 'm-freedrag-item',
  mixins: [props],
  data() {
	return {
		freedragItem: `position: absolute;`
	}
  },
  computed: {
    posStyle() {
      let style = {}
      style.top = this.yAxial + 'px'
      style.left = this.xAxial + 'px'
      return `position: absolute;top: ${this.yAxial}px;left: ${this.xAxial}px;`
    },
  },
}
</script>

<style lang="scss" scoped>
.freedrag-item {
  position: absolute;
}
</style>