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

[feature] Use the Vue official guide to Augmenting Global Properties #2963

Open
Cyenoch opened this issue Sep 30, 2024 · 0 comments
Open

[feature] Use the Vue official guide to Augmenting Global Properties #2963

Cyenoch opened this issue Sep 30, 2024 · 0 comments

Comments

@Cyenoch
Copy link

Cyenoch commented Sep 30, 2024

What problem does this new feature solve?

declare module '@vue/runtime-core' {
export interface ComponentCustomProperties {
W3mConnectButton: Pick<W3mConnectButton, 'size' | 'label' | 'loadingLabel'>
W3mAccountButton: Pick<W3mAccountButton, 'disabled' | 'balance'>
W3mButton: Pick<W3mButton, 'size' | 'label' | 'loadingLabel' | 'disabled' | 'balance'>
W3mNetworkButton: Pick<W3mNetworkButton, 'disabled'>
W3mOnrampWidget: Pick<W3mOnrampWidget, 'disabled'>
}
}

In my project it seems that declare module '@vue/runtime-core' { ... } caused me to lose the global type of $t and the others in the template. I'm sorry I can't provide a minimal reproducible example. I couldn't reproduce it in a new project, but in my project once I removed import { useAppKit } from '@reown/appkit/vue' everything worked.

Describe the solution you'd like

I'm currently patching this in another project to declare module 'vue' { ... } to get the types to work properly.

https://vuejs.org/guide/typescript/options-api.html#augmenting-global-properties

Vue exposes a ComponentCustomProperties interface designed to be augmented via TypeScript module augmentation:

I'm not sure if changing this will result in losing compatibility with older versions of Vue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant