Subscribe on changes!

use a interface for defineProps from import

avatar
Dec 7th 2021

Version

3.2.16

Reproduction link

sfc.vuejs.org/

Steps to reproduce

vue file

<script setup lang="ts">
import { ref } from 'vue'
import { IProp } from './a'

 const props = withDefaults(defineProps<IProp>(),{
    flag: true
 })
  
const msg = ref('Hello World!')
</script>

<template>
  <h1>{{ msg }}</h1>
  <input v-model="msg">
</template>

import interface ts file

export interface IProp {
  flag?:boolean
}

What is expected?

can use the way import ts file to define the props that defineProps need

What is actually happening?

complier error