web3modal icon indicating copy to clipboard operation
web3modal copied to clipboard

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

Open Cyenoch opened this issue 1 year ago • 0 comments

What problem does this new feature solve?

https://github.com/reown-com/appkit/blob/405327bdc3c8f42cb8a6b7684c174d1e285147ec/packages/appkit/src/library/vue/index.ts#L23-L31

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

Cyenoch avatar Sep 30 '24 04:09 Cyenoch