在 setup 语法糖中使用 defineProps 时
interface Props {
/* ... */
}
export {
type Props
}
<script setup lang="ts">
import { Props } from '.'
const props = defineProps<Props>()
</script>
[@vue/compiler-sfc] type argument passed to defineProps() must be a literal type, or a reference to an interface or literal type.
Props 从外部引用,接口继承可用
interface Props {
/* ... */
}
定义的类型不正确
在别的地方搜到了,当前使用的版本没法解决这个问题