<template>
  <div class="vuc-treecombox-toolbar">
    <template v-for="(item,idx) in toolbar">
      <span class="vuc-treecombox-toolbar-btn"
            :key="`${_uid}_${idx}`"
            type="text"
            @click="handleClick(item)">
        <Icon :type="item.icon"
              :custom="item.icon"
              size="16" />{{item.text}}</span>
    </template>
  </div>
</template>

<script>
export default {
  name: 'VucTreecomboxToolbar',
  props: {
    toolbar: {
      type: Array,
      default: () => []
    }
  },
  methods: {
    handleClick(item) {
      this.$emit('on-toobar-click', item)
    }
  }
}
</script>

<style lang="less" scoped>
.vuc-treecombox-toolbar {
	text-align: right;
	&-btn {
		display: inline-block;
		margin: 0px 8px;
		padding: 0px 8px;
		cursor: pointer;
		&:hover {
			color: #6495ed;
		}
	}
}
</style>
