<template>
  <u-poptip v-model="visible" class="uif-poptip-lite" :trigger="trigger" :placement="placement" :offset="0">
    <u-icon :type="icon" :active="visible" scene="action"></u-icon>
    <template v-slot:content>
      <slot></slot>
    </template>
  </u-poptip>
</template>

<script>
import UPoptip from '@uif/hq/src/components/poptip'
import UIcon from '@uif/hq/src/components/icon'
import {oneOf} from '@uif/hq/src/utils/assist'
export default {
  inheritAttrs: false,
  name: 'u-poptip-lite',
  components: {
    UIcon,
    UPoptip
  },
  props: {
    icon: {
      type: String,
      default: 'star-solid'
    },
    trigger: {
      validator (value) {
        return oneOf(value, ['click', 'hover'])
      },
      default: 'hover'
    },
    placement: {
      type: String,
      default: 'bottom-end'
    }
  },
  data () {
    return {
      visible: false
    }
  }
}
</script>
