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
After upgrading to 0.36 x version can't get to use the < script setup > syntactic sugar component types #1400
Comments
Hi @RennCheung, maybe you want to use |
when use unplugin-vue-components with import '@vue/runtime-core'
declare module '@vue/runtime-core' {
export interface GlobalComponents {
AfCard: typeof import('./src/anyforce/components/card.vue')['default']
}
}
|
@exherb See #1405 (comment). |
Thanks, is this a temporary solution? |
@exherb AfCard should not report error if it is valid component type. Can you show |
<template>
<div>
<div
:class="[
'rounded-t-lg border flex items-center justify-between',
headerClass,
]"
>
<slot name="header">
{{ header }}
</slot>
</div>
<div :class="['rounded-b-lg border-b border-l border-r', bodyClass]">
<slot />
</div>
</div>
</template>
<script lang="ts">
export default defineComponent({
props: {
header: {
type: String,
default: "",
},
headerClass: {
type: String,
default: "p-2 text-base",
},
bodyClass: {
type: String,
default: "p-2",
},
},
});
</script> |
just a simple component @johnsoncodehk |
@exherb where are |
I used
defineExpose
in the child component:But you can't use
typeof
to obtain the corresponding types in the parent component, and error message will appear:The text was updated successfully, but these errors were encountered: