element-plus / element-plus-icons

Main package for storing Element Plus icon resources.
MIT License
138 stars 100 forks source link

node16.20.0版本, vue3+typescript 使用button icon的时候 ide会有个类型错误的警告信息 #61

Closed HongJian-Yang closed 1 year ago

HongJian-Yang commented 1 year ago

新建的空项目, 再button上使用Search等图标的时候, 会提示Search有问题, 代码运行起来样式没问题, 仅仅是个 警告

import {Search} from '@element-plus/icons-vue'

  <div>
    <el-button :icon="Search" circle/>
  </div>
Type DefineComponent<{}, {}, {}, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}> is not assignable to type string | Component
  "dependencies": {
    "@element-plus/icons-vue": "^2.1.0",
    "element-plus": "^2.3.8",
    "vue": "^3.2.47"
  },
  "devDependencies": {
    "@vitejs/plugin-vue": "^4.1.0",
    "typescript": "^4.9.3",
    "vite": "^4.2.0",
    "vue-tsc": "^1.2.0"
  }

image