Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use a interface for defineProps from import #5068

Closed
AlphaYoung111 opened this issue Dec 7, 2021 · 1 comment
Closed

use a interface for defineProps from import #5068

AlphaYoung111 opened this issue Dec 7, 2021 · 1 comment

Comments

@AlphaYoung111
Copy link

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

@Niputi
Copy link

Niputi commented Dec 7, 2021

duplicate of #4294

@github-actions github-actions bot locked and limited conversation to collaborators Oct 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants