<template>
  <!-- <div>
    <el-menu  class="el-menu-toolbar" mode="horizontal" @select="handleSelect">
    <el-submenu  v-for="(value, key, pindex) in datavToolMap" :index="key" :key="pindex">
      <template slot="title">
        <i class="el-icon-menu"></i>
        <span slot="title">{{value.desc}}</span>
      </template>
        <draggable
          class="flex-container"
          tag="div"
          :list="value.items"
          v-bind="{group:{ name:'form', pull:'clone',put:false},sort:false, ghostClass: 'ghost'}"
          @end="handleMoveEnd"
          @start="handleMoveStart"
          :move="handleMove"
        >
         <el-menu-item  v-for="(item, key, index) in value.items" :key="index" :index="item.alias">
            <template slot="title">
              <i class="el-icon-location"></i>
              <span slot="title">{{item.name}}</span>
            </template>
          </el-menu-item>
        </draggable>
    </el-submenu>
  </el-menu>
  </div> -->
 <div>
    <div style="display: fix;height: 45px;line-height: 40px;overflow-x: auto;overflow-y: hidden;">
      <div v-for="(value, key, index) in datavToolMap" :key="index" style="padding-right:45px;">
        <draggable
          class="flex-container"
          tag="div"
          :list="value.items"
          v-bind="{group:{ name:'form', pull:'clone',put:false},sort:false, ghostClass: 'ghost'}"
          @end="handleMoveEnd"
          @start="handleMoveStart"
          :move="handleMove"
        >
          
          <div class="block" style="float: left;padding-right:5px;" v-for="(item, key, index) in value.items" :key="index">
            <img :src="item.icon" :title="item.name" style="width: 40px; height: 40px;position: relative;display: inline-block;overflow: hidden;" class="image">
          </div>
        </draggable>
      </div>
    </div>
  </div> 
</template>
<script>
import Draggable from "vuedraggable";
export default {
  name: "column-toolbar",
  components: { Draggable },
  data() {
    return {
      currentDate: new Date()
    }
  },
  props: {
    datavToolMap: {
      type: Object
    }
  },
  methods: {
    handleSelect:function($event){
      this.handleMoveEnd();
    },
    handleMoveEnd: function() {},
    handleMoveStart: function() {},
    handleMove: function() {}
  }
};
</script>
<style>
.el-menu-toolbar{
  height: 48px;
}
.el-submenu{
  height: 48px;
}
.el-menu--horizontal>.el-submenu .el-submenu__title{
  height: 48px;
}
.time {
    font-size: 13px;
    color: #999;
  }
  
  .bottom {
    margin-top: 13px;
    line-height: 12px;
  }

  .button {
    padding: 0;
    float: right;
  }

  .image {
    width: 100%;
    display: block;
  }

  .clearfix:before,
  .clearfix:after {
      display: table;
      content: "";
  }
  
  .clearfix:after {
      clear: both
  }

  .tools{
    height: 100%;
    line-height: 35px;
  }
  .item-direction{
    line-height: 40px;
    width: 45px;
  }
</style>