<template>
  <!--  element-plus 图标 暂未适配，需要平台端完成后 -->
  <el-icon v-if="icon.includes('el-icon')">
    <menuIcon />
  </el-icon>
  <svg-icon
    v-else
    :icon-class="icon"
  />
  <span>{{ title }}</span>
</template>

<script setup>
import SvgIcon from '@/icons/svg-icon.vue'
const props = defineProps({
  icon: {
    type: String,
    default: ''
  },
  title: {
    type: String,
    default: ''
  }
})
const menuIcon = () => {
  if (props.icon.includes('el-icon')) return h(`${props.icon.split('el-icon-')[1]}`, '这是什么标签？')
  return []
}
</script>
