Skip to content

Support for Vue 3 and Typescript #109

Open

Description

@ashkantaravati

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)

Activity

  1. vandelpavel commented on Dec 20, 2021

    @vandelpavel

    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
        };
      }
    }
  2. amchconsult commented on Dec 29, 2021

    @amchconsult

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

    thank you

  3. robinrossow commented on May 25, 2023

    @robinrossow

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions