ionic-team/ionicons

Type string is not assignable to type InferPropType<StringConstructor>

開放

#1,096 建立於 2022年8月24日

 (1 則留言) (0 個反應) (0 位負責人)TypeScript (2,083 個分叉)batch import
help wantedtype: documentation

倉庫指標

星標
 (17,256 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

I'm using Vue3 with TypeScript:

import { IonIcon } from "@ionic/vue";
import { beer }from "ionicons/icons";

<ion-icon :icon="beer" />

but am getting this TypeScript warning: Type string is not assignable to type InferPropType<StringConstructor>

After some googling I still don't understand what this means. What is a StringConstructor type that the icon prop expects? My code is working but I don't like errors/warnings in my code.

貢獻者指南