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

Support for Vue 3 and Typescript #109

Open
ashkantaravati opened this issue Jun 13, 2021 · 3 comments
Open

Support for Vue 3 and Typescript #109

ashkantaravati opened this issue Jun 13, 2021 · 3 comments

Comments

@ashkantaravati
Copy link

Hi,
I'm working on a project that uses Vue 3 and Typescript. I was wondering if you could include a type declaration module (.d.ts file) in the package. I'd be glad to help but I'm kinda a novice in this.

Could not find a declaration file for module 'vue-numeric'. '[redacted]/node_modules/vue-numeric/dist/vue-numeric.min.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/vue-numeric` if it exists or add a new declaration (.d.ts) file containing `declare module 'vue-numeric';`ts(7016)
@vandelpavel
Copy link

vandelpavel commented Dec 20, 2021

Just created a small module declaration. Surely not the best...
vue-numeric.d.ts

declare module "vue-numeric" {
  import Vue from "vue";

  interface VueNumeric extends Vue, HTMLInputElement {
    props: {
      currency: string; // Currency prefix
      currencySymbolPosition: string; // Position of the symbol (accepted values: prefix or suffix)
      decimalSeparator: string; // Custom decimal separator
      emptyValue: number; // Value when input is empty
      max: number; //	Maximum value allowed
      min: number; // Minimum value allowed
      minus: boolean; // Enable/disable negative values
      outputType: string; // Output Type for input event
      placeholder: string; // Input placeholder
      precision: number; // Number of decimals
      readOnly: boolean; // Hide input field and show the value as text
      readOnlyClass: string; // Class for read-only element
      separator: string; // Thousand separator symbol (accepts space, . or ,)
      thousandSeparator: string; // Custom thousand separator
    };
  }
}

@amchconsult
Copy link

Hi Kevin,
Are you going to do a Vue3 version?
I have test the one mentioned but it is not working.

thank you

@robinrossow
Copy link

I rewrote this component for my needs in TS and for Vue3, maybe it suits your needs to?
https://github.com/robinrossow/vue-input-number

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

No branches or pull requests

4 participants