<template>
  <el-tooltip placement="top" :open-delay="openDelay">
    <div slot="content">
      <p class="vve-tooltip-p">
        <span class="vve-tooltip-nickname">{{model.nickname}}</span>
        <span class="vve-tooltip-name">（{{model.name}}）</span>
        <a :href="url" target="__blank" class="vee-tooltip-link" :title="url">更多</a>
      </p>
      <p v-html="model.desc" class="vee-tooltip-desc"></p>
    </div>
    <slot></slot>
  </el-tooltip>
</template>
<script>
import { Tooltip } from 'element-ui'
import { ECHARTS_OPTIONS_URL } from '../constant'

export default {
  components: {
    'ElTooltip': Tooltip,
  },
  props: {
    model: {
      type: Object,
      default () {
        return {}
      }
    },
    propPath: {
      type: String,
      default: ''
    },
    openDelay: {
      type: Number,
      default: 500
    }
  },
  data () {
    return {
      ECHARTS_OPTIONS_URL
    }
  },
  computed: {
    url () {
      return this.model.url || `${this.ECHARTS_OPTIONS_URL}#${this.propPath}`
    }
  }
}
</script>
<style lang="scss">
</style>
