79469768

Date: 2025-02-26 12:49:25
Score: 1
Natty:
Report link

I use $filters in my Vue JS 3 project and to use it with Typescript I created vue.d.ts file:

export {}
declare module 'vue' {
    interface ComponentCustomProperties {
        $filters: any;
    }
}

Now, I can add filters like this:

vueApp.config.globalProperties.$filters = {
...
}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Loïc Ovigne