cgdddd
V2EX  ›  问与答

vue3 中$attrs 怎么用 ts 定义类型?

  •  
  •   cgdddd · Apr 8, 2022 · 1793 views
    This topic created in 1641 days ago, the information mentioned may be changed or developed.
    <ElSelect>
        <template v-if="$attrs.optionList && $attrs.optionList.length > 0">
          <DbOption
            v-for="item in $attrs.optionList"
            :key="item.value"
            v-bind="item"
          />
        </template>
    </ElSelect>
    

    image-20220408164718077

    各位大佬帮忙看看这个类型报错应该如何解决?

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2428 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 12:13 · PVG 20:13 · LAX 05:13 · JFK 08:13
    ♥ Do have faith in what you're doing.