Item.vue 739 B

12345678910111213141516171819202122232425262728293031323334
  1. <template>
  2. <div>
  3. <i v-if="icon.includes('el-icon')" :class="[icon, 'sub-el-icon', 'anticon']" />
  4. <svg-icon v-else :icon-class="icon" class="anticon" />
  5. <slot name="title">
  6. <span class="anticon-item">{{ title }}</span>
  7. </slot>
  8. </div>
  9. </template>
  10. <script lang="ts">
  11. import { defineComponent, PropType } from 'vue'
  12. export default defineComponent({
  13. name: 'Item',
  14. props: {
  15. icon: {
  16. type: String as PropType<string>,
  17. default: ''
  18. },
  19. title: {
  20. type: String as PropType<string>,
  21. default: ''
  22. }
  23. }
  24. })
  25. </script>
  26. <style lang="less" scoped>
  27. .anticon-item {
  28. opacity: 1;
  29. transition: opacity .3s cubic-bezier(.645,.045,.355,1),width .3s cubic-bezier(.645,.045,.355,1);
  30. }
  31. </style>