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

TypeScript: getDotLottieInstance should be defined (vue3) #187

Open
1 task done
emmanuelgeoffray opened this issue Apr 24, 2024 · 3 comments
Open
1 task done

TypeScript: getDotLottieInstance should be defined (vue3) #187

emmanuelgeoffray opened this issue Apr 24, 2024 · 3 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed vue

Comments

@emmanuelgeoffray
Copy link

Overview

image

The doc for the vue package mentions a getDotLottieInstance function but it is not in the component typing.

getDotLottieInstance is not defined, triggering TS issues and losing type.

I think that we should use defineExpose at this line

as explained in the Vue docs here

Consuming repo

dotlottie-vue

Labels

  • Add the Type: Bug label to this issue.
@theashraf theashraf added good first issue Good for newcomers bug Something isn't working labels Apr 24, 2024
@afsalz afsalz self-assigned this Apr 26, 2024
@theashraf theashraf added the help wanted Extra attention is needed label May 24, 2024
@theashraf
Copy link
Member

@afsalz any updates on this ?

@theashraf theashraf added the vue label May 24, 2024
@afsalz
Copy link
Collaborator

afsalz commented May 27, 2024

Hi @emmanuelgeoffray ,

We are using the defineComponent function to define our Vue component. It appears that defineExpose primarily works with .vue files.

In our current setup, we receive the expose function as a second argument in the setup function, as shown below:

import { defineComponent } from 'vue';

export default defineComponent({
  setup(props, { expose }) {
    expose({
      someMethod() {
        // ...
      }
    });
  }
});

We tried using defineExpose, but it doesn't seem to have any effect in this context.

If you have a solution, we would greatly appreciate your contribution.

@theashraf , we are working on a solution for this.

Thank you!

@emmanuelgeoffray
Copy link
Author

hey @afsalz
thank you for your work on this bug.
I'm sorry but no, I don't know the solution :)
Maybe you will find it in other projects that provide components for both vue and react, like Tiptap or Moveable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed vue
Projects
None yet
Development

No branches or pull requests

3 participants