vue3 setup defineProps的泛型从外部引入报错
这样引入报错 Syntax Error: TypeError: Cannot read property 'content' of null
<script lang="ts" setup>
import type { IProps } from "./type"
import { withDefaults, defineProps } from "vue"
// interface IProps {
// title: string
// activeBgc?: string
// activeColor?: string
// }
const props = defineProps<IProps>()
</script>
这样正常
<script lang="ts" setup>
// import type { IProps } from "./type"
import { withDefaults, defineProps } from "vue"
interface IProps {
title: string
activeBgc?: string
activeColor?: string
}
const props = defineProps<IProps>()
</script>