Skip to content

Support for Vue v3.4 v-bind shortand syntax  #3830

Closed
@cexbrayat

Description

@cexbrayat

In Vue v3.4, it is possible to write:

<script setup>
import { ref } from 'vue'

const disabled = ref(true)
</script>

<template>
  <button :disabled>Log in</button>
</template>

But vue-tsc throws with:

error TS2322: Type '{}' is not assignable to type 'Booleanish | undefined'.

26       <button :disabled>Log in</button>
                 ~~~~~~~~~

  ../node_modules/.pnpm/@vue+runtime-dom@3.4.0-rc.3/node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts:411:5
    411     disabled?: Booleanish;
            ~~~~~~~~
    The expected type comes from property 'disabled' which is declared here on type 'ButtonHTMLAttributes & ReservedProps'

See the repro on the playground

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions