Skip to content

how to define the return value type of app.mount() #7493

Discussion options

You must be logged in to vote

This solution should solve your problem.

import myComponent from './myComponent.vue'
import type { ComponentPublicInstance } from 'vue'
import type MyComponent from './myComponent.vue'

type MyComponentInstance = InstanceType<typeof MyComponent>

const tooltipInstance = createApp(myComponent).mount('#v-tooltip')  as ComponentPublicInstance<MyComponentInstance>
tooltipInstance.content = 'xxx'

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Mr-Nobody-li
Comment options

@chenxch
Comment options

Answer selected by Mr-Nobody-li
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants